Page 1 of 1

ESP32-S3 read encoder and get difference from last reading

Posted: Mon Dec 04, 2023 9:49 pm
by Windorey
Hello, I am trying to make a code that will read the difference of the rotarty encoder from when it was last read with PCNT peripheral.

For example, if I turn it 3 times anticlockwise after the last read, the next read will show -3, and if I have not touched it since the last read, it will be 0.

I have tried the PCNT rotary encoder example, but I do not understand how it works and I am getting the count doubled.

Any help would be greatly appreciated.