fix(doorbell-touch): add touch debug logging and missing TFT_MISO pin
This commit is contained in:
@@ -11,6 +11,10 @@ void DisplayDriverTFT::begin() {
|
||||
|
||||
Serial.printf("[GFX] Display OK: %dx%d\n", DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
||||
|
||||
// Debug: check if touch controller is responding
|
||||
uint16_t z = _tft.getTouchRawZ();
|
||||
Serial.printf("[TOUCH] Raw Z=%d (non-zero = controller detected)\n", z);
|
||||
|
||||
drawBoot();
|
||||
|
||||
digitalWrite(PIN_LCD_BL, HIGH);
|
||||
@@ -118,10 +122,12 @@ void DisplayDriverTFT::drawDashboard(const ScreenState& st) {
|
||||
TouchEvent DisplayDriverTFT::readTouch() {
|
||||
TouchEvent evt;
|
||||
uint16_t tx, ty;
|
||||
if(_tft.getTouch(&tx, &ty)) {
|
||||
uint8_t touched = _tft.getTouch(&tx, &ty, 100);
|
||||
if(touched) {
|
||||
evt.pressed = true;
|
||||
evt.x = tx;
|
||||
evt.y = ty;
|
||||
Serial.printf("[TOUCH] x=%d, y=%d\n", tx, ty);
|
||||
}
|
||||
return evt;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
// ── SPI Pins (from lcdwiki.com/4.0inch_ESP32-32E_Display) ──
|
||||
#define TFT_MISO 12
|
||||
#define TFT_MOSI 13
|
||||
#define TFT_SCLK 14
|
||||
#define TFT_CS 15
|
||||
|
||||
Reference in New Issue
Block a user