summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-02-21 17:13:11 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-02-21 17:13:11 -0500
commita26ce3f49e9d88302b7d16a0197b58119519650e (patch)
treee921531e559fb38f32adb33629ef16e78e897007
parenta4f1f4363ed39972c0ac3541adf885c20ec19f58 (diff)
display the minimum battery voltage
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/HwRobot.java13
1 files 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);