View Full Version : Limit Switches
Joseph W. Horth
21-02-2011, 17:45
After a bit of search I couldn't find what I needed to know, so here goes; How should Limit Switches be wired in coding? I have a limit switch on each of the pivot points on our arm but when even one of them is hit it kills every function on the robot. It stores the inputs as I can see them on the driver station however, it won't let me move any of them. I've included both a picture of the Teleop.vi code and a picture of the Begin.vi, thanks for taking the time to read this.
It appears that you have name them incorrectly, you called it limit in begin and limit1 in teleop.
Joseph W. Horth
21-02-2011, 18:16
I fixed that and am still having the problem. Help!
benjamin.narin
21-02-2011, 18:58
The code for the limit switch itself looks fine to me.
I'd look at the case structures it's wired to, wiring on the robot, broken limit switches. etc...
Alan Anderson
21-02-2011, 23:53
I have a limit switch on each of the pivot points on our arm but when even one of them is hit it kills every function on the robot.
I'll bet you a bottle of Mountain Dew that you have your limit switches miswired between ground and the +5 pin of the DIO instead of the signal pin. As soon as a switch is hit, you'll short the Digital Sidecar's power and everything it's controlling will shut down.
bstites82
22-02-2011, 00:59
I'm not an expert, but from the code I can see you're logic goes true when the limit switch is activated, but you don't have an alternative argument to reverse the motor off the limit switch. I can see why this would disable the arm, but if its killing the whole bot there may be other issues.
Try deleting those error wires because when you have that error in there and you trip the limit switch it is sending an error out which could potentially stop your whole robot.
Also as for your encoders your begin should have a Config Timer and Start VI in there too. I followed the Motor with Encoder Example
DavidGitz
22-02-2011, 22:56
Also as for your encoders your begin should have a Config Timer and Start VI in there too. I followed the Motor with Encoder Example
In Begin.vi
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.