Skip to content

Commit

Permalink
Simplify SmartDashboard checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
c-x-berger committed Feb 2, 2019
1 parent 9e00795 commit 2997acf
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package frc.robot;

import edu.wpi.first.wpilibj.Preferences;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
Expand Down Expand Up @@ -32,17 +31,13 @@ public void robotInit() {
// chooser.addOption("My Auto", new MyAutoCommand());
SmartDashboard.putData("Auto mode", chooser);

if (!SmartDashboard.containsKey("Display Drivetrain data?")) {
SmartDashboard.putBoolean("Display Drivetrain data?", false);
SmartDashboard.setPersistent("Display Drivetrain data?");
String[] displays = new String[]{"Display Drivetrain data?", "Display navX data?"};
for (String display : displays) {
if (!SmartDashboard.containsKey(display)) {
SmartDashboard.putBoolean(display, false);
SmartDashboard.setPersistent(display);
}
}
Preferences.getInstance().putBoolean("Display Drivetrain data?", false);

if (!SmartDashboard.containsKey("Display navX data?")) {
SmartDashboard.putBoolean("Display navX data?", false);
SmartDashboard.setPersistent("Display navX data?");
}
Preferences.getInstance().putBoolean("Display navX data?", false);
}

/**
Expand Down

0 comments on commit 2997acf

Please sign in to comment.