You can use any of our boards with a digital input
to read the state of the switch. In the case of an active-low digital input (every board but the 1012 is active-low), attach one end of the switch to a digital input and the other end to ground. Then, add a pull-up resistor (that is, a 5kOhm resistor that leads to the 5V pin on the board) to the side that leads to the digital input. This way, the input will be at a high voltage (logic false) when the switch is open, and ground voltage (logic true) when the switch is closed.
Once you have the true/false value of the switch in your program, it's just a matter of getting the same program to switch the power to the arm off. If the same board used above has a digital output, you can use this to control a relay that is connected in-line to the power supply to the arm.
mparidis - first, thanks very much for your reply. Unfortunately, I'm not that experienced in this area and so I'm having to look up a few of the words used in your reply
So that you can better understand what I’m trying to do, I’ve taken pictures of the switch that I’m using (or something very similar) as well as a diagram of my understanding of the wiring you suggest, but I can’t find a way to upload them here so I will have to try to explain.
I had mentioned initially that it was a SPDT switch (with only one of the throws connected) but on closer inspection there is only one external connection - which makes it a SPST switch. This
is something like the one I’m using - it suggests it is push-to-break.
There are only two wires in the cable connected to the switch - brown connected to the pole (input) and blue to the throw (output).
Using the 1101_0 board, for example, are you suggesting I should connect the brown wire from the switch to the ground pin of the board and the blue to the digital input of the board (INP1)? Then also place a 5kOhm resistor from the digital input on the board to the VCC pin (in series)?
I appreciate it is obviously a lot easier to explain with a diagram so please let me know if I’m anywhere close. Thanks again!
berkinet wrote:You also might want to look at a less mechanical means of detecting position, like a magnet and a hall-effect sensor, or possibly using a light sensor to measure reflected light off of a white area on the disk -- of course, both of these methods need to provide a long enough "contact" time to be captured.
berkinet - thank you for your reply as well; unfortunately the equipment i have been provided with at the moment does not allow me any flexibility on how
to measure the position of arm - I'm stuck with the switch button! but thanks again anyway!