View Single Post
  #9   Spotlight this post!  
Unread 14-02-2010, 12:00
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Joystick Button One-Shot (a.k.a. Rising Edge) Detection

Quote:
Originally Posted by grosh View Post
We want a ramp to move UP when button 1 is pressed AND only when button 1is pressed. We want the ramp to go DOWN when button 2 is pressed AND only when button two is pressed.

Our issue is we need the ramp to stop when the ramp is all the way down, hence the need for a switch.
Controlling a motor with a pair of buttons is not difficult. Use the state of the first button to select between the True and False of a case block, wiring a constant zero out of the False case and wiring the desired "UP" motor speed out of the True case. Run that output through another case block controlled by the second button, wiring the value straight through without modification in the False case and wiring the desired "DOWN" motor speed out of the True case. Run that output through the In Range and Coerce select block controlled by the limit switch; I showed an example of that a few posts ago.
Reply With Quote