@@ -0,0 +1,3474 @@
+/*----------------------------------------------------------------------------*/%0A/* Copyright (c) FIRST 2008. All Rights Reserved.                             */%0A/* Open Source Software - may be modified and shared by FRC teams. The code   */%0A/* must be accompanied by the FIRST BSD license file in the root directory of */%0A/* the project.                                                               */%0A/*----------------------------------------------------------------------------*/%0A%0Apackage edu.wpi.first.wpilibj.templates;%0A%0Aimport edu.wpi.first.wpilibj.Joystick;%0Aimport edu.wpi.first.wpilibj.RobotDrive;%0Aimport edu.wpi.first.wpilibj.Timer;%0Aimport edu.wpi.first.wpilibj.SimpleRobot;%0Aimport edu.wpi.first.wpilibj.Victor;%0Aimport edu.wpi.first.wpilibj.Gyro;%0A/**%0A * The VM is configured to automatically run this class, and to call the%0A * functions corresponding to each mode, as described in the SimpleRobot%0A * documentation. If you change the name of this class or the package after%0A * creating this project, you must also update the manifest file in the resource%0A * directory.%0A */%0Apublic class RobotClass extends SimpleRobot %7B%0A    //This function is called once each time the robot enters autonomous mode.%0A    private Gyro gyro; //creating the object gyro%0A    double Kp = 0.03; //proportional scaling constant, the angle is multiplied by 0.03 to correct its path%0A   %0A    public RobotClass()%0A    %7B %0A        chassis.setExpiration(0.1);%0A    %7D%0A  %0A    Victor frontRight = new Victor(3); //set which motor is hooked up to which port.%0A    Victor frontLeft = new Victor(1);%0A    Victor backRight = new Victor(4);%0A    Victor backLeft = new Victor(2);%0A    %0A    RobotDrive chassis = new RobotDrive(frontLeft, backLeft, frontRight, backRight);%0A     Joystick driveStick = new Joystick(1);%0A    %0A    %0A    public void autonomous() %7B%0A        gyro.reset(); //restets gyro to forward%0A        chassis.setSafetyEnabled(false); // it is a safety mechanism that will stop the motor if the speed isn't updated%0A        while (isAutonomous()) %7B //creates while loop%0A            double angle = gyro.getAngle(); //retrevies angle that the gyro is reading %0A            chassis.drive(0.3, -angle*Kp);//adjusts angle of drive to correct inefficiencies in the motors%0A            Timer.delay(0.004); %0A        %7D%0A        chassis.drive(0.0, 0.0);//stops robot%0A        %0A        %0A      //  chassis.drive(-0.2, 0.0); // driving in a negative directon at a speed of 0.2%0A      //  Timer.delay(2.0); // waiting for 2.0 seconds%0A       // chassis.drive(0.0, 0.0); // stopped driving    %0A    %7D%0A%0A    /**%0A     * This function is called once each time the robot enters operator control.%0A     */%0A    public void operatorControl() %7B%0A        chassis.setSafetyEnabled(true); //enables safety%0A        //chassis.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true); //inverts motors so that they don't fight each other.%0A        //chassis.setInvertedMotor(RobotDrive.MotorType.etX()); //get the inputs from left & rigt stick%0A            Timer.delay(0.01); //update every 0.01 secondskFrontLeft, true); %0A        while (isOperatorControl() && isEnabled()) %7B //while loop for re-updating speed and such%0A            chassis.arcadeDrive(-driveStick.getY(),-driveStick.getX()); //get the inputs from left & rigt stick%0A            Timer.delay(0.01); //update every 0.01 seconds%0A        %7D %0A %0A    %7D%0A    %0A    /**%0A     * This function is called once each time the robot enters test mode.%0A     */%0A    public void test() %7B%0A    %0A    %7D%0A%7D%0A

Create Drivetrain.java