|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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); } } } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|