On Thu, 19 Jun 2008 18:01:05 +0100, "Tom=E1s =D3 h=C9ilidhe" said: > = > Imagine a tri-colour LED. It has 3 pins: two anodes and a common cathode. > = > Now lets say we wanted to control this with a PIC chip, and we only need = > two colours. Easy, we just tie the cathode to ground and then take two = > pins from the PIC chip, putting one pin to each LED anode. > = > When we want both LED's off, we just put both pins low. > When we want it green, we put Pin 1 high and Pin 2 low. > When we want it red, we put Pin 1 low and Pin 2 high. > = > OK, easy stuff. What I'm trying to do though is use one sole PIC pin to = > achieve this. The PIC pin's three states would correspond to: > = > Pin High =3D Green > Pin Low =3D Red > Pin as Input =3D Neither If you have a reference voltage that is half supply(perhaps using two resistors as a voltage divider) and a two pin red/green LED, that works just fine when the supply voltage is 5 volts. Attach the LED from PIC pin to center of resistor divider. Of course you have continuous current drain through the resistor divider. With a three pin red/green LED you will need to use two diodes as well. Attach a diode across each LED section in reverse. Now you have a red/green LED that is functionally similar to a two wire red/green LED (attach nothing except the diodes to the middle pin). This doesn't work so well in practice since the voltage drop of a diode adds to that of an LED, and you need to run from only 2.5 volts. Give it a try and see how it goes. Red will definitely work. Green probably won't really work, but it might be good enough since you seem like someone who will try anything. Using unequal value resistors can balance it out a bit. Using Schottky diodes will help too. Cheerful regards, Bob = -- = http://www.fastmail.fm - Same, same, but different=85 -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist