This is a discussion of well behaved (YMMV), interrupt driven, rotary encoder switch interfacing.
[TUT] Interfacing 2 bit rotary encoder switches
your word doc describes exactly what I need to do! Very cool. Do you have any sample code?
Thank you
Dancy
Unfortunately I don't have any code, although it's easy from the description to write. You might start a new thread asking for some if you need it. I'm sure many people have some they'd be glad to share.
Hi there,
I have written some code which works fine for me, but:
a) it must be called from timer interrupt
b) requires one variable to remember the last state
c) regonises only full steps (which I found better for 'device behaviour').
Some time ago I tried using two external interrupts, but with no success.
From the .doc file:
The jitter settles out by itself without the debouncing, however, and for many applications would not be a problem.
I use encoder to change many values in my program, that are displayed on LCD. And I just wonder if the jitter won't be visible when user changes value? If you could propose some debouncing function (or description) I'm ready to test it;) It would be nice to have external interrupts driven encoder routines, than timer polled ones.
Anyway, if you're interested in my code (and if it applies here), please let me to know.
Best regards,
A. Telszewski