Instantiate and run gyro method in TeleOp
authorEvanYap <evanyap.14@gmail.com>
Sat, 30 Jan 2016 22:17:06 +0000 (14:17 -0800)
committerEvanYap <evanyap.14@gmail.com>
Sat, 13 Feb 2016 05:14:23 +0000 (21:14 -0800)
src/org/usfirst/frc/team3501/robot/Robot.java
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java

index bc3d735e22ec36829f0e05dfaa074f4d42ef1b03..45505462ec9c858d15a60fc4cb96021388b167c7 100644 (file)
@@ -138,6 +138,5 @@ public class Robot extends IterativeRobot {
   @Override
   public void teleopPeriodic() {
     Scheduler.getInstance().run();
-
   }
 }
index 6c004b42eea16bd0afd9db354925939176b5bd0e..7c27d12e3d3e99a7bf60f6e8efcf3c96630f3576 100644 (file)
@@ -1,8 +1,10 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.FirebotGyro;
 import org.usfirst.frc.team3501.robot.Lidar;
 
+import edu.wpi.first.wpilibj.AnalogInput;
 import edu.wpi.first.wpilibj.CANTalon;
 import edu.wpi.first.wpilibj.CounterBase.EncodingType;
 import edu.wpi.first.wpilibj.Encoder;
@@ -31,6 +33,9 @@ public class DriveTrain extends Subsystem {
       Kd = 0.0 * (OUTPUT_SPROCKET_DIAMETER / PULSES_PER_ROTATION)
           / (WHEEL_SPROCKET_DIAMETER) * WHEEL_DIAMETER;
 
+  public AnalogInput channel;
+  public FirebotGyro gyro;
+
   public DriveTrain() {
     frontLeft = new CANTalon(Constants.DriveTrain.FRONT_LEFT);
     frontRight = new CANTalon(Constants.DriveTrain.FRONT_RIGHT);
@@ -47,6 +52,8 @@ public class DriveTrain extends Subsystem {
     leftEncoder.setDistancePerPulse(INCHES_PER_PULSE);
     rightEncoder.setDistancePerPulse(INCHES_PER_PULSE);
 
+    gyro = new FirebotGyro(I2C.Port.kOnboard, (byte) 0x68);
+
   }
 
   @Override
@@ -98,4 +105,5 @@ public class DriveTrain extends Subsystem {
     this.rearLeft.set(leftSpeed);
     this.rearRight.set(-rightSpeed);
   }
+
 }