Reads up to 4 rotary (incremental) encoder: https://en.wikipedia.org/wiki/Incremental_encoder
The a and b signals are first debounced at a configurable frequency.
The encoder counts from 0 to 255.
Address | Name | Access | Description |
---|---|---|---|
0x00 | DATA | R | Value of Encoder 0 |
0x01 | DATA | R | Value of Encoder 1 |
0x02 | DATA | R | Value of Encoder 2 |
0x03 | DATA | R | Value of Encoder 3 |
0x04 | DATA | R/W | Debounce frequency. Will be left shifted by 4 |
Connect up to 4 incremental encoders to the input port (see pin mapping).
Use the test firmware to read the value of the encoder and print it out.
Rotary incremental encoders. Most encoder Pmod boards have pull-up / pull-down resistors. If you are using a bare encoder, you will need to add your own pull-up / pull-down resistors.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | enc0 a | ||
1 | enc0 b | ||
2 | enc1 a | ||
3 | enc1 b | spi_miso | |
4 | enc2 a | spi_cs_n | |
5 | enc2 b | spi_clk | |
6 | enc3 a | spi_mosi | |
7 | enc3 b |