Last edited by sayzer; - 16th July 2010 at 12:24. Reason: typo
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Yes, the four states can be obtaind with only one pin. Very nice!
Now, if you use the red-green LED that I mentioned above a cool project can be made.
http://futurlec.com/LED/LED3RG.shtml
Since red + green = yellow, then with only one pin in the MCU we can obtain four different states in the LED: off, red, green, or yellow. Also, by varying the percentage duty cycle of the square wave different shades of yellow can be obtained. I haven't tried this yet but it might be a cool project.
Robert
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
![]()
Bookmarks