Simple Rotary Encoder code

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Post Reply
rich
Posts: 81
Joined: 19 November 2015, 12:23 PM

Simple Rotary Encoder code

Post by rich »

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
Attachments
debounce_ckt.pdf
Circuit to de-bounce rotary encoder outputs A and B.
(21.34 KiB) Downloaded 328 times
encoder.zip
ZBasic code files
(2.04 KiB) Downloaded 328 times
Post Reply