View Single Post
  #1   Spotlight this post!  
Unread 19-09-2013, 08:01
Matt_4505 Matt_4505 is offline
Registered User
FRC #4505
Team Role: Programmer
 
Join Date: Nov 2012
Rookie Year: 2012
Location: United States
Posts: 16
Matt_4505 is on a distinguished road
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);
}
Reply With Quote