Go Down

Topic: Two swtiches on one pin (Read 698 times) previous topic - next topic

paulb

Apr 09, 2008, 03:09 am Last Edit: Apr 09, 2008, 03:12 am by paulb Reason: 1
Short on I/O pins?


I read a clever idea in EDN (Electronic Design News) that exploited uC pin pullup resistors to read two switches (or a center-off toggle/slide switch) with one pin.

I wrote up the idea in Arduino format and put it in the tutorials. Didn't test it however so may have egg on my face. If it doesn't work let me know.

paulb

http://www.arduino.cc/en/Tutorial/TwoSwitchesOnePin

Oracle

I don't know if this has been covered in Arduino circles, but it's fairly trivial to put a bunch of switches on one analog input using resistors.   Even if multiple switches can be closed at once and the software needs to know which ones, there should be no trouble with 4-5 on a single analog input with appropriately chosen resistors.  The theoretical limit would be 10 for the 10-bit ADC, but theory rarely works in practice.

paulb

Yes I've seen that done too. We should put up the schematics for that somewhere. It's easy.

Paul

paulb

Yes I've seen that done too. We should put up the schematics for that somewhere. It's easy.

Paul

Go Up