I think this might work (sorry for the verbal description, but I didn't feel like firing up eagle) You will need the following parts: 1: The LED 2: A limiting resistor for the LED (say 300 ohms) 3: A 47K or so resistor 4: A small capacitor 5: The switch Make the following connections: Connect the 300 ohm resistor from Vcc to the anode of the LED Connect the cathode of the LED to the PIC pin. Connect the cap from one terminal of the switch to ground Connect the other terminal of the switch to the PIC pin Connect the 47K resistor from the PIC pin to ground Now: To turn on the LED, actively pull the pin low. To test the state of the switch do the following: 1: Actively drive the pin high long enough to charge the capacitor if the switch is closed 2: Turn the pin into an input and wait a couple of instructions. 3: Read the input. If it is high then the switch must be closed because the capacitor is discharging thru the 47K. If it is low then the switch is open. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: "Tony Nixon" To: Sent: Wednesday, September 26, 2001 10:04 PM Subject: Re: [EE]: Multiplex LED and switch on I/O pin > Dave Dribin wrote: > > > Hmm... thanks for the suggestion, but I really wanted to keep the LED > > independent from the switch. In this application it's not possible to > > have the LED turn on and off with the switch. Is this possible? > > I don't think it is possible. > > You can't drive the LED with a high IO pin and then try to read a switch > that's trying to pull that same IO pin low. > > -- > Best regards > > Tony > > mICros > http://www.bubblesoftonline.com > mailto:sales@bubblesoftonline.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.