The file "encoder_one.bas" is a simple quadrature rotary encoder interface. It is easy to follow and works well.
The file "encoder_tst.bas" called the encoder_one function and displays the counter to the debug terminal.
Note the outputs from the rotary encoder are debounced with a RC filters and a 74HC14 schmitt trigger inverters.
This makes the rotary encoder code simple.
cheers,
Richard
Simple Rotary Encoder code
Simple Rotary Encoder code
- Attachments
-
- debounce_ckt.pdf
- Circuit to de-bounce rotary encoder outputs A and B.
- (21.34 KiB) Downloaded 327 times
-
- encoder.zip
- ZBasic code files
- (2.04 KiB) Downloaded 328 times