View Single Post
  #3   Spotlight this post!  
Unread 17-01-2014, 03:29
wre136's Avatar
wre136 wre136 is offline
Registered User
AKA: Will Edds
FRC #2461 (The METAL-SKINS)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Oklahoma City
Posts: 30
wre136 is an unknown quantity at this point
Re: Limit Switch help

In your specific request, I would suggest that you look into implementing a State-Machine. You would create an enum that would have all the states your shooter would be in. For grins, the states I would use would be: Begin, Ready (Unloaded), Firing and Ready (Loaded). You would then feed the enum into a case structure so the robot will do something different in the states and the states could move the code to the next state.

To see this concept in action, here is a link to video on how to create a simple state machine for lifting a ball on FRCMastery: http://www.frcmastery.com/labview-fo...tate-machines/

The idea would be you would set your Ready-Loaded state to perhaps ignore the status of the limit switch so you can press the fire button and it will go.

Hope this points you in the right direction!
Reply With Quote