Go to Post I love it when someone tells me I can't do something. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-02-2015, 17:34
5580SQUAD 5580SQUAD is offline
Registered User
FRC #5580
 
Join Date: Feb 2015
Location: Canada
Posts: 5
5580SQUAD is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2015, 17:49
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Mentor, LRI, MN RPC
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,827
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
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.
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2015, 12:52
5580SQUAD 5580SQUAD is offline
Registered User
FRC #5580
 
Join Date: Feb 2015
Location: Canada
Posts: 5
5580SQUAD is an unknown quantity at this point
Re: Need help with a limit switch

Do I need to import anything else other than the talon in my code?
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2015, 13:31
fireXtract fireXtract is offline
MegaHertz_Lux
FRC #2847 (Mega Hertz)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: fmt
Posts: 42
fireXtract is an unknown quantity at this point
Re: Need help with a limit switch

Quote:
Originally Posted by 5580SQUAD View Post
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2015, 13:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Need help with a limit switch

Quote:
Originally Posted by 5580SQUAD View Post
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


Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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