Shop OBEX P1 Docs P2 Docs Learn Events
I can make a 2 color LED display 3 different colors. — Parallax Forums

I can make a 2 color LED display 3 different colors.

danielcg25danielcg25 Posts: 3
edited 2012-04-04 19:52 in BASIC Stamp
It flashes between green and red as fast as my BASIC Stamp BS2 can go. It looks orange to me when I do that.

I'm just wondering, will switching the polarity that fast damage anything?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-04 19:44
    No, switching polarity wont damage the LED that's want they're made to do. You do want to make sure you use the correct current limiting resistor.

    You should be able to get different variations of color by mixing the red and green in different proportions.

    It still amazes me that red and green make yellow.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-04-04 19:45
    No, you're fine. That's a common way to produce mid-range colors from red/green LEDs.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-04-04 19:47
    Duane Degn wrote:
    It still amazes me that red and green make yellow.
    The don't really "make" yellow. They still produce sharp peaks in the red and green part of the color spectrum. But, when neighboring red-sensitive and green-sensitive cones in our retinae are stimulated equally we "see" yellow.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2012-04-04 19:48
    danielcg25,

    No damage at all, that's typically how color mixing is done. In your case the duty cycle is probably close to 50%. If you alter the duty cycle between the two colors you can gradually fade from red to green.

    The PWM command might give you a finer control without flickering.
                        \\ 
                    o---->|----o----/\/\---> Vdd
                    |          |
    PWM I/O >-------o          |
                    |          |
                    o----|<----o----/\/\---> Vss
                          \\
    
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-04 19:52
    The don't really "make" yellow. They still produce sharp peaks in the red and green part of the color spectrum. But, when neighboring red-sensitive and green-sensitive cones in our retinae are stimulated equally we "see" yellow.

    -Phil

    :tongue:Well they "make" yellow in my brain.

    Okay, you're right. (but so am I)
Sign In or Register to comment.