Go to Post stop whining about something that can be solved by working harder. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-02-2013, 17:47
Nyle's Avatar
Nyle Nyle is offline
Registered User
FRC #0422 (The Mech Tech Dragons)
Team Role: Leadership
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Richmond, Virginia
Posts: 28
Nyle is just really niceNyle is just really niceNyle is just really niceNyle is just really nice
How to code limit switch to stop movement

Our robot's articulator for adjusting the vertical angle of the shooter has limit switches on the top and bottom to stop it from going too far in either direction. Currently our code has three methods in the shooter articulator subsystem used for moving it: moveUp(), moveDown(), and stop(). The moveUp() and moveDown() methods check if the limit switch they would be moving towards is pressed, if it is not sets the talon to 1.0 or -1.0, and if it is calls the stop() method, which sets the talon to 0. This makes sure that the articulator doesn't extend beyond where it is supposed to travel as long as one of the movement methods is being called continually (currently they are), but if they aren't being continually called the limit switches won't stop the articulator from moving (for instance, if moveUp() were to be called once, it would check the top limit switch, and if it isn't pressed, set the talon to 1.0. This unfortunately won't stop when the limit switch is pressed.). I have a feeling that there is a better way to do this, but I don't know what it is. Any suggestions?
Reply With Quote
 


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 12:06.

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