From a26ce3f49e9d88302b7d16a0197b58119519650e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 21 Feb 2017 17:13:11 -0500 Subject: display the minimum battery voltage --- src/org/usfirst/frc/team4272/robot2017/HwRobot.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java index 8dbfd51..091b68b 100644 --- a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java +++ b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java @@ -31,6 +31,7 @@ package org.usfirst.frc.team4272.robot2017; import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.PIDOutput; import edu.wpi.first.wpilibj.PIDSourceType; @@ -71,13 +72,15 @@ public class HwRobot { public final Encoder lDriveE = new Encoder(/*DIO*/0,/*DIO*/1, /*reverse*/false); 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 final DriverStation ds = DriverStation.getInstance(); public DoubleSolenoid shifter = new DoubleSolenoid(/*PCM*/4, /*PCM*/5), ged = new DoubleSolenoid(/*PCM*/6, /*PCM*/7); + private double maxRate = 0; + private double minBatt = 20; + public HwRobot() { lDriveE.setDistancePerPulse(10.0/*feet*/ / 1865.75/*pulses*/); rDriveE.setDistancePerPulse(10.0/*feet*/ / 1865.75/*pulses*/); @@ -107,6 +110,12 @@ public class HwRobot { maxRate = rate; SmartDashboard.putNumber("maxRate", maxRate); + double batt = ds.getBatteryVoltage(); + SmartDashboard.putNumber("batt", batt); + if (batt < minBatt) + minBatt = batt; + SmartDashboard.putNumber("minBatt", minBatt); + SmartDashboard.putBoolean("highGear", c.highGear); SmartDashboard.putBoolean("gedOut", c.gedOut); -- cgit v1.2.3-54-g00ecf