From da6933e215fe3761e652de42ef17bcd38d297ef2 Mon Sep 17 00:00:00 2001 From: EvanYap Date: Fri, 12 Feb 2016 20:59:25 -0800 Subject: [PATCH] rename print line statement to say Degrees: and rename AnotherGyroClass to GyroLib from another team --- .../{AnotherGyroClass.java => GyroLib.java} | 16 ++++++++-------- src/org/usfirst/frc/team3501/robot/Robot.java | 11 ++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) rename src/org/usfirst/frc/team3501/robot/{AnotherGyroClass.java => GyroLib.java} (97%) diff --git a/src/org/usfirst/frc/team3501/robot/AnotherGyroClass.java b/src/org/usfirst/frc/team3501/robot/GyroLib.java similarity index 97% rename from src/org/usfirst/frc/team3501/robot/AnotherGyroClass.java rename to src/org/usfirst/frc/team3501/robot/GyroLib.java index c358b8bf..36d177c3 100644 --- a/src/org/usfirst/frc/team3501/robot/AnotherGyroClass.java +++ b/src/org/usfirst/frc/team3501/robot/GyroLib.java @@ -50,7 +50,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; * */ -public final class AnotherGyroClass { +public final class GyroLib { /** * Object used to monitor robot rotation. * * */ public final class Rotation implements RotationTracker { @@ -126,7 +126,7 @@ public final class AnotherGyroClass { /** * Constructor is protected, instances are created through the - * {@link AnotherGyroClass} methods. + * {@link GyroLib} methods. * * @param axis * An accumulator from the gyro for the axis to be tracked. @@ -355,7 +355,7 @@ public final class AnotherGyroClass { * This should be true if the ITG-3200 has the AD0 jumpered to logic * level high and false if not. */ - public AnotherGyroClass(I2C.Port port, boolean jumper) { + public GyroLib(I2C.Port port, boolean jumper) { m_addr = (jumper ? itgAddressJumper : itgAddressNoJumper); m_i2c = new I2C(port, m_addr); m_thread = new Thread(new Runnable() { diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 5e916ac9..b1b58641 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,7 +1,7 @@ package org.usfirst.frc.team3501.robot; -import org.usfirst.frc.team3501.robot.AnotherGyroClass.Rotation; import org.usfirst.frc.team3501.robot.Constants.Defense; +import org.usfirst.frc.team3501.robot.GyroLib.Rotation; import org.usfirst.frc.team3501.robot.subsystems.DefenseArm; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; @@ -32,7 +32,7 @@ public class Robot extends IterativeRobot { // Gyro stuff short rawValue; - public AnotherGyroClass gyro; + public GyroLib gyro; double now; double degreesIncreased; @@ -43,7 +43,7 @@ public class Robot extends IterativeRobot { @Override public void robotInit() { // driveTrain = new DriveTrain(); - gyro = new AnotherGyroClass(I2C.Port.kOnboard, false); + gyro = new GyroLib(I2C.Port.kOnboard, false); // oi = new OI(); shooter = new Shooter(); @@ -150,12 +150,17 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { + + gyro.start(); + } @Override public void teleopPeriodic() { Scheduler.getInstance().run(); + System.out.println("Degrees: " + gyro.getRotationZ().getAngle()); + } } -- 2.30.2