View Single Post
  #2   Spotlight this post!  
Unread 19-02-2012, 14:58
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Dividing Speed on Robot Drive

It needs to be placed in the "IsOperatorControl()" loop where TankDrive() is being called now. call the GetY() method of the joysticks to get the value and multiply it by your scale. I would use decimals like 0.25. For example:

R_myRobot.TankDrive(J_stick1->GetY() * 0.25, J_stick2->GetY() * 0.25);

When you don't want to scale keep
R_myRobot.TankDrive(J_stick1, J_stick2);

In our example below, you forgot to multiply by 0.5 when button one was pressed.

You don't need "== true" in your checks for GetRawButton(). It returns a bool
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote