This file implements the physical start-button task. It debounces the user pushbutton, toggles the course-enable Share, and can clear bump events when beginning a new run.
It provides a clean hardware-based interface for starting or stopping the autonomous course without needing the serial console.
| Name | Description |
|---|---|
_btn | Input pin object for the hardware pushbutton. |
_courseEnable | Share that enables or disables the obstacle-course routine. |
_bumpEvent | Optional Share cleared when starting a new run. |
_prev | Previous button state used for edge detection. |
_t_last | Timestamp of the last accepted button event. |
_debounce | Debounce interval in milliseconds. |
_hb_t | Heartbeat timer used for periodic debug printouts. |
This file improves usability and repeatability by allowing the robot to be started from a physical button in a clean, debounced way. It also prevents stale bump events from affecting the next run.