|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
robotDrive.drive help?
So we had the program work so that if (stickRight.getRawButton(1) == true)
{robotDrive.drive(1.0,0.0); } if (stickLeft.getRawButton(1) == true)_ {robotDrive.drive(0.2,0.0); } but when we try this it works partially. When we push button 1 on stickRight, it moves faster but only one motor moves faster. Vice versa with button 1 on stickLeft, only one motor moves slow. Any help? |
|
#2
|
||||
|
||||
|
Re: robotDrive.drive help?
try robotDrive.arcadeDrive(speed,turn);
|
|
#3
|
|||
|
|||
|
Re: robotDrive.drive help?
well, i didnt get a chance to try that, but essentially I'm trying to have it set up so that when i press one button the robot will drive faster. And if i press another button the robot will drive slower.
|
|
#4
|
|||||
|
|||||
|
Re: robotDrive.drive help?
Quote:
I'd recommend having your program use Jaguar objects in your Drive train instead of integers (assuming you are using int's) Once you do this you should be able to limit it in teleop. Code:
RobotDrive drive = new RobotDrive(leftMotor, rightMotor);
if(leftMotor.get() >= 0.5) {
leftMotor.set(0.5);
} else if(rightMotor.get() >= 0.5) {
rightMotor.set(0.5);
}
// then call your drive methods and it'll limit the max speed to 0.5
|
|
#5
|
|||
|
|||
|
Re: robotDrive.drive help?
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|