Finite State Machine managing SmartKnob behavior and modes.
More...
#include <FSM.h>
|
| enum class | Mode { Elastic
, FreeSpin
} |
| enum class | Function { Translate
, Rotate
} |
|
| | FSM (Motor &motor, Encoder &encoder, PID &pid, Hall &hall, UART_HandleTypeDef *huart) |
| | Constructs the FSM controller.
|
| void | run (uint32_t freq) |
| | Runs the active FSM state at the specified frequency.
|
| void | advanceState (bool longPress) |
| | Advances to the next state depending on button press type.
|
Finite State Machine managing SmartKnob behavior and modes.
◆ FSM()
| FSM::FSM |
( |
Motor & | motor, |
|
|
Encoder & | encoder, |
|
|
PID & | pid, |
|
|
Hall & | hall, |
|
|
UART_HandleTypeDef * | huart ) |
Constructs the FSM controller.
- Parameters
-
| motor | Reference to Motor instance. |
| encoder | Reference to Encoder instance. |
| pid | Reference to PID controller. |
| hall | Reference to Hall effect sensor. |
| huart | UART handle for serial communication. |
◆ advanceState()
| void FSM::advanceState |
( |
bool | longPress | ) |
|
Advances to the next state depending on button press type.
- Parameters
-
| longPress | If true, jumps directly to FreeSpin-Rotate mode. |
◆ run()
| void FSM::run |
( |
uint32_t | freq | ) |
|
Runs the active FSM state at the specified frequency.
- Parameters
-
| freq | Frequency to limit execution rate (Hz). |
The documentation for this class was generated from the following files:
- C:/Users/nickl/OneDrive - Cal Poly/POLY4TH/SPRING'25/507/LAB WORKSPACE/SmartKnobController_REV2/Core/DoxCommd/FSM.h
- C:/Users/nickl/OneDrive - Cal Poly/POLY4TH/SPRING'25/507/LAB WORKSPACE/SmartKnobController_REV2/Core/DoxCommd/FSM.cpp