Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arduino ILI9341 TFT Display Pitanja
#25
Probaj ovo da zamenis  :
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
Reply


Messages In This Thread
Arduino ILI9341 TFT Display Pitanja - by ronovar - 10-08-2018, 12:48 PM
RE: Arduino ILI9341 TFT Display Pitanja - by me[R]a - 04-12-2019, 11:27 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)