View Single Post
  #1   Spotlight this post!  
Unread 15-01-2012, 23:23
Stagger007 Stagger007 is offline
Registered User
FRC #4379
 
Join Date: Jan 2012
Location: Weston, FL
Posts: 10
Stagger007 is an unknown quantity at this point
Help With Programing

Hello my team is a rookie team and its the first time we do FRC and we finally got the java image on the cRIO now were running ode that is directly copied from the java guide and its not running. Our code is as follows:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Servo;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Joystick;

public class RobotTemplate extends SimpleRobot {
RobotDrive drive = new RobotDrive(1, 2);
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);
/**
* This function is called once each time the robot enters autonomous mode.
*/
public void autonomous() {
for(int i =0; i < 4; i++){
drive.drive(0.5, 0.0);
Timer.delay(2.0);
drive.drive(0.0, 0.75);
Timer.delay(0.75);
}
drive.drive(0.0,0.0);
}

public void operatorControl() {
while (isOperatorControl() && isEnabled()){
drive.tankDrive(leftStick, rightStick);
Timer.delay(.005);

}

}
}
Reply With Quote