1,0
0,1
0,0
LEDs on these states won't be possible by one pin.
Instead, use 4017 with one pin.
I have an example here:
http://www.picbasic.co.uk/forum/showthread.php?t=6548&
1,0
0,1
0,0
LEDs on these states won't be possible by one pin.
Instead, use 4017 with one pin.
I have an example here:
http://www.picbasic.co.uk/forum/showthread.php?t=6548&
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Jumper,
You can use "one LED" only like the one in the link below. This is pretty much two LEDs put together. It is a red-green 3mm LED.
http://futurlec.com/LED/LED3RG.shtml
However, the bad news is that Sayzer is right. You can't get three states "0,0", "0,1", and "1,0" with only one MCU pin.
Robert
Last edited by ScaleRobotics; - 13th July 2010 at 22:48.
I think this page explains what Walter is doing pretty well ...
http://www.batsocks.co.uk/readme/p_tut_led16.htm
DT
Simplest coding would be to generate a square wave signal on the pin, and then set the TRIS based on state of each LED. TRIS would have to be set every time you change the state of the pin in the square wave generating code. That way the LEDs will always be the same brightness. Of course the square wave signal would have to be interrupt driven off of a timer in order to have both LEDs on at the same time.
Tim Barr
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
Bookmarks