View Single Post
  #4   Spotlight this post!  
Unread 02-02-2012, 15:03
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,112
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 Buttons to Control Jaguars

For an application like this, some people would suggest Case blocks, but I prefer using Select functions. They switch between one of two input values based on a boolean input. The cascaded Select for the Wheels motor will output 1 whenever Button 2 is pressed, -1 when Button 2 is not pressed and Button 3 is, and 0 when neither button is pressed. Change the constants to make the motors run at something less than full speed.
Attached Thumbnails
Click image for larger version

Name:	buttons and motors.png
Views:	209
Size:	24.7 KB
ID:	11683  
Reply With Quote