Hi Josh, I think you can do it with out any mid level voltages.. 120 PIN1 >-----------/\/\/\--, | 10K Bi Colour LED Vcc >--/\/\/\-, | | 120 | PIN2 >---------+-/\/\/\--+ | 0 | 0 | Switch 4.7K | GND >--/\/\/\-----------' Driving: Colour 1 (Green): PIN1: H PIN2: L Colour 2 (Red): PIN1: L PIN2: H Read Switch: PIN1: Tri-stated (make input) PIN2: Tri-states (make input) Allow a settling time and Read state of PIN2. Low = Switch Pressed. You would simply scan this at the high rate (Multiplexing). If you want to leave the LEDs turned off, you could drive PIN1 & PIN2 High. (probably better then tri-stating them as you stop them floating off to strange voltages, and this is a good thing with a cable.) Do it fast enough and you won't see it, AND you should be able to get a Yellow colour as well. The two 120ohm resistors are the LED current limit split between both PIC pins so they provide some ESD protection. The 10K pullup is used when reading the switch, floating the PIC pins allows it to pull the line to Vcc unless the switch is closed in which it will read about 1/3 Vcc (You may have to ensure this is a LOW buy changing values or using a Schmitt trigger input PIN). The Resistor in the ground return for the switch stops the current drain being excessive if the switch is closed when driving the LEDs. Obviously all the resistors stay on the PCB, the LED and switch go to the end of the cable. You may have problems with driving the cable capacitance, especially on reading the switch state so you may have to have some time delays in there to let the signal stabilise.. Depends on how long your cable is.. You might need to play with the values of the switch resistor and the pull up to make it work fast and reliably. Also is the cable shielded? if not doing this will probably make a wonderful antenna to radiate signals.. :) Cheers, Ash. --- Ashley Roll Digital Nemesis Pty Ltd www.digitalnemesis.com Mobile: +61 (0)417 705 718 > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Josh Koffman > Sent: Tuesday, 5 February 2002 9:52 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Driving a dual LED > > > Hi Roman. Actually, it's to get two colours and one switch on > only three > wires. My goal is to remote mount these, and three wires is > all I'd like > to use. As well, I'd like to keep the remote unit as low parts as > possible as I'd like to try and squeeze it in the shell of a > connector. > Looking over some of the other posts, I could use three pins to > accomplish this, but I wonder if I could do it with two (two > pins, three > wires). The addition of a third colour would be cool, but not really > needed. I'd like to keep it to two pins if possible, but it'll be > cheaper and easier to go to a larger PIC than to add more wires. Of > course, if there is no way to get this to work over a bunch of wire > other than to start to add gates to the remote ends, then I have a > problem. > > Josh -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body