View Single Post
  #10   Spotlight this post!  
Unread 20-05-2010, 13:59
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: button activation for motor

Assuming the answers to the first three questions I posed a couple of posts ago are all "yes":



Open the joystick and both motors in the Begin vi, giving them useful names with RefNum Set functions. Close them all in the Finish vi.

Put two Case blocks in the Teleop vi.

Wire the "Buttons" output of a Joystick Get to an Unbundle By Name and choose the two buttons you want to use.

Wire the state of the first joystick button to the selector terminal of the first Case block. Inside the "True" case, set both motors to run at the desired speed. Leave the "False" case empty.

Wire the state of the second joystick button to the selector terminal of the second Case block. Inside the "True" case, set both motors to stop. Leave the "False" case empty.



This will do exactly what you asked for, including the part about not being sure what happens when both buttons are pressed simultaneously.