I’ve been fiddling about with a rotary encoder and my Arduino with pretty hopeless results. I’ve done plenty of Googling and tried various different approaches including the basic one detailed in the Playground page for rotary encoders, using interrupts and a very clever one that used some analog pins and some seriously indecipherable code!
The various problems I’ve been having include detection in one direction only, no response at all, too many turns needed than is practical and of course some horrendous bouncing!
First of all it’s worth saying that the encoder I’ve used may well be rubbish or even faulty. It was salvaged from a dead Akai Sampler. So I’ve ordered an Alps STEC12E08 which is specifically named in some examples as working well and hopefully that’ll be Ok.
We’ll see but first a few questions.
Is the use of cheap mechanical rotary encoders just a nightmare full stop or can I expect to get good results if applied properly?
Should I be hardware debouncing even if the example code I use attempts to debounce in software?
If so then what do I use for hardware debouncing?
I’m using the rotary encoder only as a user interface device to scroll through and select a series of values on an LCD. I don’t care about it’s position only whether it turns left or right. If it does I want to effectively trigger an “event” and allow the software to increase or decease a value accordingly. Many of the code examples I’ve seen seem more complex than this. What’s the best approach for this simple task?