#include #include #include TFT_eSPI tft; const char* ssid = "FabAcademy_ESP32"; const char* password = "password123"; const char* serverUrl = "http://192.168.4.1/"; void setup() { Serial.begin(115200); tft.begin(); tft.setRotation(3); tft.fillScreen(TFT_BLACK); tft.println("Conectando al ESP32..."); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); tft.print("."); } tft.fillScreen(TFT_BLACK); tft.println("¡Conectado!"); } void loop() { if (WiFi.status() == WL_CONNECTED) { HTTPClient http; http.begin(serverUrl); int httpCode = http.GET(); if (httpCode > 0) { String payload = http.getString(); // Dibujar en pantalla tft.fillScreen(TFT_BLACK); tft.setTextColor(TFT_CYAN); tft.setTextSize(3); tft.setCursor(20, 50); tft.println("TEMPERATURA:"); tft.setTextSize(7); tft.setTextColor(TFT_WHITE); tft.setCursor(60, 120); tft.print(payload); tft.print("C"); } http.end(); } delay(1000); // Actualiza cada segundo }