View Single Post
  #6   Spotlight this post!  
Unread 12-12-2015, 13:42
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: how to toggle motors in c++ using buttons

If you can post your entire code (or just the teleoperated part) that will help.

I imagine the problem is what Poseidon said, your Robot object's TankDrive() method is taking priority over your code.

The code that you posted SHOULD be working,(when the trigger is pressed on the joystick, the Talon moves the motor at full speed), assuming everything is initialized properly and the robot class isn't using those Talons for tank drive.
__________________
1771- Programmer, Captain, Drive Team (2009-2012)
4509- Mentor (2013-2015)
1771- Mentor (2015)