pull up/down with rotary selector switch
i have rotary selector switch 6 positions, plus common 7 contacts. want keep things simple wiring each of 6 switch legs input on arduino. can i:
if works, there isn't way combine pulldowns, there?
- connect each leg ground via own pulldown
- also connect each leg input pin
- use single 100 ohm resistor common +5v
if works, there isn't way combine pulldowns, there?
you can use internal pull-up resistors:
then ground common terminal. pin low signal 1 selected.
you can use external pull-down resistors, 1 per pin, , connect common terminal +5. pin high signal 1 selected.
code: [select]
pinmode(2, input);
digitalwrite(2, high); // enable internal pull-up
then ground common terminal. pin low signal 1 selected.
you can use external pull-down resistors, 1 per pin, , connect common terminal +5. pin high signal 1 selected.
Arduino Forum > Using Arduino > General Electronics > pull up/down with rotary selector switch
arduino
Comments
Post a Comment