Thread: my code
View Single Post
  #11   Spotlight this post!  
Unread 28-02-2011, 21:31
Garten Haeska's Avatar
Garten Haeska Garten Haeska is offline
Registered User
AKA: Garty
FRC #2861 (Infinity's End)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Lake City, MN
Posts: 219
Garten Haeska has a spectacular aura aboutGarten Haeska has a spectacular aura about
Re: my code

Quote:
Originally Posted by lineskier View Post
beware of the logic here, as if the limit switch is triggered there is no way to get the arm off of the switch

my solution to this is to rather than stop, prohibit movement in one direction.

pseudo code would look something like this.

if(limit == true && y>1)
stop();
else
arm.run(js.getY);
This is somewhat what i want to do, i only want the switch to be powered in auto. so then i can extend past it to floor load, and i just want the switch to turn off the arm when the arm hits the switch. im just clueless right now.
__________________
"Sometimes the questions are

complicated but the answers are simple."

- Dr. Seuss
Reply With Quote