Open felmue opened 4 years ago
Hi Rop
I used to be able to do this on an M5Core2:
void loop() { M5.update(); if(M5.BtnA.pressedFor(2000) == true) { Serial.println("A: pressed for 2s"); } }
but now pressedFor(2000) is true immediately the first time, then the button doesn't react until I wait 2 seconds before touching it again. I can fix it by inserting a manual read M5.BtnA.read().
pressedFor(2000)
true
M5.BtnA.read()
void loop() { M5.update(); M5.BtnA.read(); if(M5.BtnA.pressedFor(2000) == true) { Serial.println("A: pressed for 2s"); } }
Is that to be expected or am I missing something.
BTW: From what I can tell with only the M5.update() the buttons _lastChange doesn't get updated properly.
M5.update()
_lastChange
Thanks Felix
Hi Rop
I used to be able to do this on an M5Core2:
but now
pressedFor(2000)
istrue
immediately the first time, then the button doesn't react until I wait 2 seconds before touching it again. I can fix it by inserting a manual readM5.BtnA.read()
.Is that to be expected or am I missing something.
BTW: From what I can tell with only the
M5.update()
the buttons_lastChange
doesn't get updated properly.Thanks Felix