diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-02-20 23:26:46 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-02-20 23:26:46 -0500 |
commit | 4be375f15d0f391cb22f07879d0441daccc75939 (patch) | |
tree | ecc839249e6478fd8d8d897e0943edbdb6cc4a93 /src/org | |
parent | 3fb1facb65da53d49c8f387a3df3bc7478298677 (diff) |
HwRobot: SmartDashboard display stuff.
Diffstat (limited to 'src/org')
-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); |