Page 1 of 1

Rotary Encoder Driver, (polled, +button)

Posted: Tue Apr 25, 2017 3:12 pm
by robert_o
This is my first attempt to write a driver using ChibiOS.
This Demo reads a rotary encoder connected to PINS A0,A1,A4 of a Nucleo F411 and dumps
the Values and Button state to uart2 (38400Baud).
It features a polled encoder interface, so you can use any pins you want.
It is intended for user input, NOT quadrature encoders mounted to motors.
I tried to use the chibiOS driver structure.
Feedback is very appreciated.

Re: Rotary Encoder Driver, (polled, +button)

Posted: Tue Apr 25, 2017 4:47 pm
by Giovanni
Moving this thread to user projects, just in case somebody is interested.

Giovanni

Re: Rotary Encoder Driver, (polled, +button)

Posted: Tue Nov 13, 2018 6:50 pm
by DaveRodda
When the code finds a low-to-high transition on the A channel, it checks to see if the B channel is high or low and then increments/decrements the variable to account for the direction that the encoder must be turning in order to generate the waveform found.