Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

Rotary Encoder Example#

Overview#

This sample demonstrates blocking event reads for a rotary encoder.

Source file:

src/rtsmart/examples/peripheral/rotary_encoder/test_rotary_encoder.c

Sample Behavior#

  • waits for events through rotary_encoder_wait_event()

  • prints delta, total_count, direction, and timestamp

  • resets the counter after a 2-second long press

Runtime Parameters#

./test_rotary_encoder [timeout_ms]

Build and Run#

cd src/rtsmart/examples/peripheral/rotary_encoder
make
./test_rotary_encoder [timeout_ms]

Notes#

Enable CONFIG_ENABLE_ROTARY_ENCODER before using the sample.

Comments list
Comments
Log in