diff options
Diffstat (limited to 'src/org/usfirst/frc')
-rw-r--r-- | src/org/usfirst/frc/team4272/robot2016/HwRobot.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java index c0c6749..1368d97 100644 --- a/src/org/usfirst/frc/team4272/robot2016/HwRobot.java +++ b/src/org/usfirst/frc/team4272/robot2016/HwRobot.java @@ -43,6 +43,8 @@ public class HwRobot { public final Encoder rDriveE = new Encoder(/*DIO*/2,/*DIO*/3, /*reverse*/true); public final PowerDistributionPanel PDP = new PowerDistributionPanel(); /* via CAN */ + private double maxRate = 0; + public DoubleSolenoid shifter = new DoubleSolenoid(/*PCM*/4, /*PCM*/5), ged = new DoubleSolenoid(/*PCM*/6, /*PCM*/7); @@ -66,10 +68,18 @@ public class HwRobot { shifter.set(c.highGear ? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward); ged.set(c.gedOut ? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward); + double rate = Math.abs((lDriveE.getRate()+rDriveE.getRate())/2); SmartDashboard.putNumber("lDriveE distance", lDriveE.getDistance()); - SmartDashboard.putNumber("lDriveE rate", lDriveE.getRate()); + SmartDashboard.putNumber("lDriveE rate", Math.abs(lDriveE.getRate())); SmartDashboard.putNumber("rDriveE distance", rDriveE.getDistance()); - SmartDashboard.putNumber("rDriveE rate", rDriveE.getRate()); + SmartDashboard.putNumber("rDriveE rate", Math.abs(rDriveE.getRate())); + SmartDashboard.putNumber("rate", rate); + if (rate > maxRate) + maxRate = rate; + SmartDashboard.putNumber("maxRate", maxRate); + + SmartDashboard.putBoolean("highGear", c.highGear); + SmartDashboard.putBoolean("gedOut", c.gedOut); //PDP.updateTable(); //SmartDashboard.putData("PDP", PDP); |