Hi,
Several years back I purchased a rotary encoder from somewhere and have periodically used it in breadboarded projects. It's been in and out of breadboard so many times its pins have broken off. So I bought a bunch of rotary encoders from Ebay a while back, thinking that they were all pretty much the same. How very wrong I was!
I just discovered that the newer encoders I bought increment 3 (sometimes 4) times versus the old one's single increment.
I am trying to use one in a project in which I am following this tutorial:
I have tried changing values in the relevant method: readRotaryEncoder() , as well as the header and cpp files without any success (I managed to make the number of increments larger, but not smaller), however I am not an accomplished enough programmer to be able to make it work with the new rotary encoder.
Can anyone suggest how I might achieve this?
I have attached the header and cpp files and here is the readRotaryEncoder method:
void readRotaryEncoder()
{
value += encoder->getValue();
if (value/2 > last) {
last = value/2;
down = true;
delay(150);
}else if (value/2 < last) {
last = value/2;
up = true;
delay(150);
}
}
ClickEncoder.cpp (5.81 KB)
ClickEncoder.h (2.68 KB)
Nokia5110MenuRotary_CHANGING_v1_1.ino (18.2 KB)