Probaj ovo da zamenis :
Sa ovim :
I probaj taj attachInterrupt da vozis sa RISING
Code:
// Rotary Encoder - increase/decrease temp by 5°C
void doEncoder() {
// If there is a minimal movement of 1 step
if (bitRead(PIND, pinA) == bitRead(PIND, pinB)) {
// Increase set temperature by 5°C
tempSet = tempSet + 5;
} else {
// Decrease set temperature by 5°C
tempSet = tempSet - 5;
}
Sa ovim :
Code:
// Rotary Encoder - increase/decrease temp by 5°C
void doEncoder() {
cli(); //stop interrupts
// If there is a minimal movement of 1 step
if (bitRead(PIND, pinA) == bitRead(PIND, pinB)) {
// Increase set temperature by 5°C
tempSet = tempSet + 5;
} else {
// Decrease set temperature by 5°C
tempSet = tempSet - 5;
sei(); //restart interrupts
}
I probaj taj attachInterrupt da vozis sa RISING