At 05:44 PM 2/5/02 -0500, Josh Koffman wrote: >I like your solution Dwayne, but it doesn't meet my requirements (it >might meet Lawrence's though. I would like to drive the bi colour LED >and a switch using only three wires. Your solution would take all three >for the LED. I do like it though...I might want to put monitoring LEDs >on the main board, and this might work out well. The question now >becomes one of finding 3 pin LEDs I like :) Actually, I WAS thinking of Lawrence's requirements - trying to reduce Iq when driving a pair of LEDs. But I think the it can also monitor a single switch fairly easily: pic pin----+--------+---res5---button----+ | | | res4 | | | A K | A K | 5V---res1--+-+--LED---+---LED---+---res2---+---GND | | +--------res3--------+ The LEDs are in series. Res1 determines LED brightness of left hand LED when PIC pin is LO. Res2 determines brightness of right hand LED when PIC pin is HI. Res3 keeps the voltage across the LEDs low enough so that they don't light when PIC pin is tri-stated. Res4 helps keep pic pin above 2.5V while the button is not pressed. Res5 limits port current while the button is pressed. This won't work on a schmitt trigger input but should work just fine on the TTL inputs (threshold about 1.4 Vdc). Lets pick some starting resistor values. Set Res1,2,3 to 470R, res4 to 10K, res5 to 470R. Pressing the button may cause LED1 to light dimly, depending upon its threshold voltage. Use a high threshold LED (green or yellow) for LED1 if possible. Voltage at pic pin should be about 3V when the button is open, less than 1V when the button is pressed. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 18 years of Engineering Innovation (1984 - 2002) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu