RED and BLUE = ON
The only way I can think of is to connect them in parallel. (if serial, 3.3V will not go through)
![]()
RED and BLUE = ON
The only way I can think of is to connect them in parallel. (if serial, 3.3V will not go through)
![]()
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Last edited by rsocor01; - 17th July 2010 at 12:51.
Hey Robert,
Can you give some example code for how the square wave method would work?
Say you have something like the sliding door app.
Green = full open
Red = closed
OFF = inbetween
Yellow = moving
Dave
Always wear safety glasses while programming.
Mackrackit,
I'm going to order this part and test it to see if it works. The square wave is just a simple 50% duty cycle wave. By using the circuit provided by Scalerobotics, then if the square wave is low the red lights up and if the square wave is high then the green lights up.
A rapid changing of colors red -> green -> red -> green -> .... would appear to be yellow. It is just an optical illusion. Remember that I talking about a red-green LED with both colors in the same LED casing. Still, I would need to test it to see if it works.
Robert
![]()
Looking forward to see your results, it would be very useful.
Dave
Always wear safety glasses while programming.
Mackrackit,
I tested this idea with a red-green 10 LED bargraph and yes it works. The setup is different from what we have been discussing in this thread, but the idea of getting a new color (yellow) is the same.
First, I applied a square wave to the circuit with a period of 1.2 seconds and you can see how the color changes between red and green. Next, I applied a square wave with a period of 2 milliseconds per cycle (50% duty cycle) and all you see is a yellow color. Also, If you change the percentage of the duty cycle you get different tones of yellow. This would be very useful for a project like the sliding doors.
Robert
COOOL!!!!!
I can think of several places where that will come in handy.
Looks like it would make a good article for the wiki. Add a bit of code and schematic for basic use....
Dave
Always wear safety glasses while programming.
Bookmarks