Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: Joker94 on December 23, 2009, 07:16:52 PM
-
Hi everyone
I want to use a switch to start a program. And i have a few questions.
1)Does it have to be a momentary push button or can it be a toggle
2) how would i go about connecting it to the mcu pin, eg. can i use a sensor bus pin, what do the 2 terminals connect to etc.
all help greatly appreciated
Joker94
-
http://www.societyofrobots.com/sensors_tactbumpswitch.shtml (http://www.societyofrobots.com/sensors_tactbumpswitch.shtml)
-
One terminal connects to +5v, other to the pin. In between the mcu pin and the terminal, a 10k resistor to gnd.
The switch can be either, the program can be changed to cope.
-
One terminal connects to +5v, other to the pin. In between the mcu pin and the terminal, a 10k resistor to gnd.
The switch can be either, the program can be changed to cope.
To simply further, just connect the 2 terminals of the switch, one to the pin, one to ground, and enable the internal pull-ups of the Micro controller. This eliminates the need for an external resistor.
-
brilliant thanks madsci1016
Joker94