View Single Post
  #2   Spotlight this post!  
Unread 02-13-2015, 03:13 PM
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: Error in Tank Drive code

It looks like you're trying to define PWM 1 and 2 as both drive motors and individual motors simultaneously. If you want to do that, declare and initialize your Talons first, then call DriveRobot() with the actual Talon objects instead of the PWM pin numbers. But I think if you remove every reference to m_motor1 and m_motor2 your code will work as you want it to. (Actually, I think it is likely to spin when you try to go straight and vice versa, because one of the drive motors probably needs to be inverted.)

You definitely shouldn't be calling TankDrive() and setting the individual motors.
Reply With Quote