Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Need help with a limit switch (http://www.chiefdelphi.com/forums/showthread.php?t=134445)

5580SQUAD 12-02-2015 17:34

Need help with a limit switch
 
We are trying to add a limit switch on two spots of our lift system for our arms. We want one at the top and bottom, however we don't know how to attach the limit switch and get Boolean values from it. If anyone knows can you please reply?

Jon Stratis 12-02-2015 17:49

Re: Need help with a limit switch
 
Limit switches have up to 3 contacts on them - a "common", a "normally open" (NO) and a "Normally Closed" (NC). Take a PWM wire and hook up the white (signal) and black (ground) wires to the limit switch. One should go to the "common" connector, the other to one of the other two, depending on how you want it to work in the code:
- A NO connection would mean the switch is "true" when not pressed and false when pressed.
- A NC connection would mean the switch is "false"when not pressed and "true" when pressed.

The roboRIO has a pull-up resistor in all of the digital inputs, so the input "sees" 5V normally, and only when the signal pin is connected to ground will it " see" ground.

Once you get the switch hooked up, plug it into one of the DIO ports.

In the code, create a DigitalInput and read the value - it'll return a Boolean true/false.

5580SQUAD 13-02-2015 12:52

Re: Need help with a limit switch
 
Do I need to import anything else other than the talon in my code?

Ether 13-02-2015 13:17

Re: Need help with a limit switch
 
Quote:

Originally Posted by 5580SQUAD (Post 1442794)
We are trying to add a limit switch on two spots of our lift system for our arms. We want one at the top and bottom, however we don't know how to attach the limit switch and get Boolean values from it. If anyone knows can you please reply?

limit switch threads that might be helpful

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit

http://www.chiefdelphi.com/forums/sh...ighlight=limit



fireXtract 13-02-2015 13:31

Re: Need help with a limit switch
 
Quote:

Originally Posted by 5580SQUAD (Post 1443333)
Do I need to import anything else other than the talon in my code?

http://wpilib.screenstepslive.com/s/4485/m/13809/l/241867-switches-using-limit-switches-to-control-behavior

The DigitalInput is the way they use to detect the inputs of the limit switch. There is a lot of good info on the WPILIB FRC provides if you can navigate it.


All times are GMT -5. The time now is 11:43.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi