View Single Post
  #3   Spotlight this post!  
Unread 14-02-2009, 08:34
programmr's Avatar
programmr programmr is offline
Registered User
AKA: Face
FRC #0522
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Staten Island, NY
Posts: 83
programmr is a jewel in the roughprogrammr is a jewel in the roughprogrammr is a jewel in the rough
Send a message via AIM to programmr
Re: Programmer a motor with a trigger

i tried that, but here let me give you the code i tried and maybe you could find somethign thats wrong

RobotDrive* myRobot;
Jaguar* leftmotor;
Jaguar* rightmotor;
myRobot = new RobotDrive(1, 2);
leftmotor = new Jaguar(1);
rightmotor = new Jaguar(2);


if (!ds->GetDigitalIn(ARCADE_MODE)) {
myRobot->TankDrive(leftStick, rightStick);
}
else {
myRobot->ArcadeDrive(leftStick);
}

if (rightStick->GetRawButton(1)) {
leftmotor->Set(-0.5);
rightmotor->Set(0.5);
}
else {
leftmotor->Set(0.0);
rightmotor->Set(0.0);
}

that's what i have, can someone please help tell me why the left motor doesnt work when i do this. if i have both positive numbers, then the left motor goes in reverse
__________________
"I would love to change the world but no one will give me the source code"