Pages: [1]   Go Down
Author Topic: Two swtiches on one pin  (Read 659 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 08, 2008, 08:12:15 pm by paulb » Logged

0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Paul
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Paul
Logged

Pages: [1]   Go Up
Jump to: