Does anyone have an example of adding a command button to a shuffleboard layout in C++? Trying to use the below, but doesn’t work. Seems to blowup the whole layout.
frc::Shuffleboard::GetTab("Subsystems").GetLayout("Drive").Add(
"Reset Gyro",
new frc2::InstantCommand(
[this] { m_drive.ZeroHeading(); },
{&m_drive}
)
).WithWidget(frc::BuiltInWidgets::kCommand) // with Command Type Widget
.WithSize(2, 1).WithPosition(0, 7); // At this location in my layout.