SmartDashboard and Shuffleboard
Every robot system you build produces data: motor current, sensor readings, state machine flags, PID error. Without a way to see that data in real time, you are debugging blind. SmartDashboard and Shuffleboard are the windows into your robot's live state — and they work whether the robot is enabled or sitting in a pit with the Driver Station connected.
By the end of this lesson, you will:
- Publish numbers, booleans, strings, and choosers to SmartDashboard using the correct put methods
- Read values from SmartDashboard for over-the-wire tuning without redeploying code
- Organize your Shuffleboard layout into tabs for Drive, Mechanisms, and Diagnostics
- Implement a
SendableChooserfor autonomous strategy selection from the Driver Station - Describe how NetworkTables underlies SmartDashboard and Shuffleboard
Why the Dashboard Exists
You cannot attach a debugger to a robot and pause it mid-match. The next best thing is live telemetry — a stream of data flowing from robot code to a screen on the driver station laptop. SmartDashboard (and its successor Shuffleboard) receives that stream over the same network link as the Driver Station control connection.
The data flows through NetworkTables — a distributed key-value store built into WPILib. When you call SmartDashboard.putNumber("Speed", 0.5), you're writing a value to a NetworkTable entry named "Speed." Shuffleboard, AdvantageScope, and any other tool connected to that table can read it. Your robot code never knows who's listening — it just publishes.
Dashboard Type Explorer
SmartDashboard can publish four primitive types plus more complex widgets. Click each to see the API call, what widget it appears as, and the FRC use case.
Writing the Basic Put Calls
All dashboard calls go in robotPeriodic() so they update in every mode — including disabled. This is the single most important dashboard rule: data that only updates in teleop is useless for pre-match diagnostics.
Reading from the Dashboard: Live Tuning
SmartDashboard is not just for output — you can also read from it. This lets you change constants like PID gains or speed limits from the laptop without redeploying. The robot reads the value every cycle, so changes take effect immediately.
Dashboard tuning is a development tool, not a production workflow. Use it during calibration sessions to find good values quickly. Once you find a working value, move it into Constants.java and remove the getNumber() call. A production robot that reads all its constants from the dashboard is a robot that loses its tuning if the dashboard connection is interrupted, or if someone accidentally edits a value during a match.
Autonomous Strategy with SendableChooser
A SendableChooser displays a dropdown menu on the dashboard. Your drive team selects the autonomous strategy before the match; your code reads the selection and runs the corresponding routine. This eliminates deploying code between matches to swap auto programs.
Shuffleboard: Organized Layout
SmartDashboard drops everything in one flat list. Shuffleboard lets you organize data into tabs and position widgets precisely. This is what the drive team actually looks at during a match — a well-organized dashboard panel is faster to read under pressure than a cluttered list.
The drive team reads the dashboard in a fraction of a second. Every layout decision either helps or hurts that reading speed.
- Drive tab: Battery voltage (top left — highest priority), alliance color, match time, game-piece indicator, auto strategy chooser. Nothing else. If the drive team has to hunt for these values, the layout is wrong.
- Mechanisms tab: State machine labels for each subsystem, current draw per motor, sensor states. Used by the operator and pit crew during calibration.
- Diagnostics tab: Raw sensor values, encoder positions, CAN bus health, watchdog timing. Used by programmers only — never in a match context.
- Boolean box indicators: Use large boolean boxes with clear labels (green = good, red = fault) rather than tiny text fields for status that the drive team needs to see at a glance.
- Save the layout. Shuffleboard layouts are saved as a JSON file. Commit it to your Git repository. A rebuilt laptop restores the layout in seconds.
Dashboard as Debugging Checklist
Select each scenario below to see which dashboard items to add and what they reveal about the underlying problem.
During pit visits at competition I ask teams to pull up their Shuffleboard and show me the robot's current state with the robot enabled and stationary. Teams with a well-organized dashboard — battery voltage visible at the top, current per motor, state machine labels, game piece indicator — can confirm in fifteen seconds that everything is nominal before queuing. Teams with a flat list of 40 values in SmartDashboard have to hunt. Teams with no dashboard at all are debugging with their eyes. A robot with a clean dashboard is a robot whose problems get caught before the match, not during it.
- All dashboard writes in
robotPeriodic(). Data visible in disabled, auto, and teleop is infinitely more useful than data visible only during a match. - Set default values in
robotInit(), read current values in periodic. TheputNumber()call inrobotInit()initializes the dashboard entry — thegetNumber()call in periodic reads whatever the user has set, defaulting to the init value if the key is missing. - Move dashboard-tuned values to
Constants.javabefore competition. Dashboard reads are a development tool. Production robots should not depend on the dashboard connection for correct behavior. - Use
setDefaultOption()for a safe autonomous fallback. The default option loads if no human selection has been made — set it to "Do Nothing" or the simplest safe auto so a DS connection issue doesn't produce a rogue autonomous. - Commit your Shuffleboard layout file to Git. The layout lives in a JSON file in your project. Adding it to source control means any team laptop restores the organized layout without manual reconfiguration.
Knowledge Check
teleopPeriodic(). The drive team checks the dashboard before a match while the robot is disabled. What do they see?SendableChooser has no setDefaultOption() set. The DS laptop crashes and reconnects two seconds before autonomous starts. What does autoChooser.getSelected() return?Build a Competition-Ready Dashboard
- Move all your existing SmartDashboard calls from any method into
robotPeriodic(). Verify that battery voltage, motor current, and sensor states are visible while the robot is disabled. - Add a
SendableChooser<String>with at least three auto options (including "Do Nothing" as the default). Publish it to SmartDashboard. InautonomousInit(), read the selection and print it to the console. - Implement one dashboard-readable constant: put
SmartDashboard.putNumber("Speed Scale", 0.6)inrobotInit(). Read it each teleop cycle withgetNumber(). Demonstrate live tuning by changing the value on the dashboard while the robot is running and observing the speed change without redeployment. - Organize your SmartDashboard into a Shuffleboard layout with two tabs: "Drive" (battery, motor amps, game piece indicator, auto chooser) and "Diagnostics" (raw sensor values, encoder positions). Save the layout file and commit it to Git.
- Bonus: Add a "Fault Summary" string to SmartDashboard that concatenates any active fault conditions: if a motor is drawing over a threshold current, if the gyro yaw is changing when the robot is stationary, or if a limit switch is stuck. A single-string health indicator is faster to scan than five individual booleans.