Driver Feedback Cues
Disclaimer: WIP and untested on 2026 hardware; map to your controllers/LEDs. Custom code built on WPILib APIs (not official WPILib sample).
Purpose: Give drivers tactile/visual cues for hub state flips and climb windows.
Code (Java/WPILib)
public class DriverFeedback {
private final XboxController controller;
private HubShiftTimer.HubState lastState = HubShiftTimer.HubState.ACTIVE;
private int lastShift = -1;
public DriverFeedback(XboxController controller) {
this.controller = controller;
}
public void update(HubShiftTimer.Status status) {
if (status.shiftIndex() != lastShift) {
pulse(0.3); // short rumble on shift change
lastShift = status.shiftIndex();
}
if (status.ourHub() != lastState) {
if (status.ourHub() == HubShiftTimer.HubState.ACTIVE) pulse(0.6);
lastState = status.ourHub();
}
}
public void climbWindow(boolean enabled) {
if (enabled) pulse(1.0);
}
private void pulse(double intensity) {
controller.setRumble(RumbleType.kBothRumble, intensity);
Timer.delay(0.15);
controller.setRumble(RumbleType.kBothRumble, 0);
}
}
Usage
- Call
updateeach periodic withHubShiftTimer.Status. - Call
climbWindow(true)at END GAME start.
Pitfalls
- Don’t block the main loop with long delays; keep pulses short.
- If using LEDs, replace rumble with CANdle/REV Blinkin calls.