View Single Post
  #4   Spotlight this post!  
Unread 20-03-2016, 17:04
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,187
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Setting Mechanism Position with Button

You need 2 functions.

Function 1: Looks at the Button, and sets a Variable when it is pressed. Make sure you "debounce" the button (all presses within n milliseconds is considered the same press).

Function 2: Looks at the Variable, and does whatever (move to different position) when it sees the variable set. When it is done, it resets the variable.
Reply With Quote