|
First Year Java Autonomous Help
Hello,
This year, I am switching my team from Labview to Java. One issue I've had with the transition is how to program Autonomous methods in Java. I have tried to write a method that will move the robot backwards for a set amount of time, at a set speed. When I try to run it, the drive motors kick the bot back for a second and then stop instead of continuing to roll back. Any help would be appreciated.
Code:
public void moveBackward(double time, double motorPower){
Hardware.chassis.tankDrive(-motorPower, -motorPower);
Timer.delay(time);
Hardware.chassis.tankDrive(0, 0);
}
|