Smartdashboard Widget help

Hello, I am a new Java programmer and my team is using the Smartdashboard for our robot. I was wondering how I could display widgets that would display data about a motor. It is kind of hard to find examples because we are using Timed Robot and not command base. I looked at the WPILIb examples and they haven’t worked for me. Could someone give a brief example on how to do this?

Thanks!

I would migrate over to Glass (if you haven’t done so already) if you would like to use widgets. You can setup plots for different motors.

Let’s also make sure that you are sending data over through network tables.

Is it possible to do it without glass? If there is a different way to display values of solenoids and motors? I want to be able to have a red and green light display based on the value of said motor or solenoid.

Thanks!

Shuffleboard has boolean boxes that you can light up red or green.

Code to add the box to a tab:

m_LowGearEntry = m_driver_tab.add("Low Gear", false)
                             .withPosition(0,1)
                             .withSize(1, 1)
                             .withWidget(BuiltInWidgets.kBooleanBox)
                             .getEntry();

Code to change the tab green or red based on boolean fed by the drivetrain gearbox position:

m_low_gear_entry.forceSetBoolean(isLowGear());

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.