feat(touch): add continuous touch polling and debug logging
This commit is contained in:
@@ -21,6 +21,20 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// ── Touch debug: poll continuously ──
|
||||
TouchEvent evt = display.readTouch();
|
||||
if(evt.pressed) {
|
||||
Serial.printf("[TOUCH] pressed: x=%d, y=%d\n", evt.x, evt.y);
|
||||
} else {
|
||||
// Debug: print raw Z even when not touched, to see controller state
|
||||
static uint32_t lastDebug = 0;
|
||||
if(millis() - lastDebug > 2000) {
|
||||
lastDebug = millis();
|
||||
uint16_t z = tftDriver.getRawTouchZ();
|
||||
Serial.printf("[TOUCH] Raw Z=%d\n", z);
|
||||
}
|
||||
}
|
||||
|
||||
// ── State machine tick ──
|
||||
logic.update();
|
||||
|
||||
@@ -68,4 +82,7 @@ void loop() {
|
||||
if(cmd.length() > 0)
|
||||
logic.onSerialCommand(cmd);
|
||||
}
|
||||
|
||||
// Yield to WiFi/BT stack (prevents Task Watchdog timeout)
|
||||
delay(10);
|
||||
}
|
||||
Reference in New Issue
Block a user