From 4be375f15d0f391cb22f07879d0441daccc75939 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 20 Feb 2017 23:26:46 -0500 Subject: HwRobot: SmartDashboard display stuff. --- src/org/usfirst/frc/team4272/robot2016/HwRobot.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/org') 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); -- cgit v1.2.3-54-g00ecf