Interface for receiving rotary encoder events. More...
Public Member Functions | |
| bool | is_running (self) |
| Return whether the encoder is currently being monitored. | |
| None | start (self, RotationCallback rotated, ButtonCallback|None button_pressed=None, ButtonCallback|None button_released=None) |
| Start monitoring the rotary encoder. | |
| None | stop (self) |
| Stop monitoring the rotary encoder. | |
| None | poll (self) |
| Perform implementation-specific polling work. | |
Interface for receiving rotary encoder events.
Positive rotation values indicate clockwise movement. Negative rotation values indicate counterclockwise movement.
| bool hardware_io.rotary_encoder.rotary_encoder_if.RotaryEncoderIf.is_running | ( | self | ) |
Return whether the encoder is currently being monitored.
| True | Encoder monitoring is active. |
| False | Encoder monitoring is stopped. |
Reimplemented in hardware_io.rotary_encoder.gpio_rotary_encoder.GpioRotaryEncoder, hardware_io.rotary_encoder.seesaw_rotary_encoder.SeesawRotaryEncoder, and rotary_encoder_runtime._NoOpRotaryEncoder.
| None hardware_io.rotary_encoder.rotary_encoder_if.RotaryEncoderIf.poll | ( | self | ) |
Perform implementation-specific polling work.
Callback-driven encoders may leave this as a no-op. Implementations that accumulate hardware events can dispatch them here.
Reimplemented in hardware_io.rotary_encoder.gpio_rotary_encoder.GpioRotaryEncoder.
| None hardware_io.rotary_encoder.rotary_encoder_if.RotaryEncoderIf.start | ( | self, | |
| RotationCallback | rotated, | ||
| ButtonCallback | None | button_pressed = None, | ||
| ButtonCallback | None | button_released = None ) |
Start monitoring the rotary encoder.
| rotated | Callback receiving signed steps since the prior event; positive values indicate clockwise rotation. |
| button_pressed | Optional callback invoked on button press. |
| button_released | Optional callback invoked on button release. |
Reimplemented in hardware_io.rotary_encoder.gpio_rotary_encoder.GpioRotaryEncoder, hardware_io.rotary_encoder.seesaw_rotary_encoder.SeesawRotaryEncoder, and rotary_encoder_runtime._NoOpRotaryEncoder.