diff --git a/examples/Display/TBeam_TFT_Shield/TBeam_TFT_Shield.ino b/examples/Display/TBeam_TFT_Shield/TBeam_TFT_Shield.ino index e178163..57e5b5b 100644 --- a/examples/Display/TBeam_TFT_Shield/TBeam_TFT_Shield.ino +++ b/examples/Display/TBeam_TFT_Shield/TBeam_TFT_Shield.ino @@ -46,14 +46,15 @@ void setup(void) touch.setHomeButtonCallback([](void *user_data) { Serial.println("Home key pressed!"); static uint32_t checkMs = 0; + if (millis() > checkMs) { - checkMs = millis() + 200; if (digitalRead(TFT_BL)) { digitalWrite(TFT_BL, LOW); } else { digitalWrite(TFT_BL, HIGH); } } + checkMs = millis() + 200; }, NULL);