Hello, I am wondering if it is possible to multiplex a pushbutton switch input and an LED output on the same I/O pin. My idea is that since the switch input only needs to be sampled every 2ms, it can be set as an output for an LED when not sampling the switch. Also, when the pin is switched to input to sample the switch, the time taken to do so is so minimal, that the LED would not even flicker. I figure the I/O pin only needs to be set as an input for just a few assembly instructions. Hardly noticeable, right? So, I've got a couple questions. First off, is the idea described above even possible? And finally, what would the resulting circuit look like? I've come up with this: LED R1 +--|<|--/\/\----o +5V -----+ | I/O | | Pin +-----+ | | \ -----+ | \ +--/\/\--+ +--o Gnd R2 SW1 However, I cannot seem to come up with R1 and R2 values that work when the switch is closed, and the pin is setup as an input. Thanks for any help! -Dave -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu