#include #include #include "TFT_eSPI.h" TFT_eSPI tft; WiFiUDP Udp; unsigned int localUdpPort = 4210; // Puerto donde escuchamos char incomingPacket[255]; // Buffer para los datos void setup() { Serial.begin(115200); tft.begin(); tft.setRotation(3); tft.fillScreen(TFT_BLACK); pinMode(LCD_BACKLIGHT, OUTPUT); digitalWrite(LCD_BACKLIGHT, HIGH); WiFi.begin("AndroidAP", "tuho3965"); while (WiFi.status() != WL_CONNECTED) { delay(500); } // ¡IMPORTANTE! Anota esta IP para ponerla en el Wemos tft.println("IP Wio: " + WiFi.localIP().toString()); Udp.begin(localUdpPort); } void loop() { int packetSize = Udp.parsePacket(); if (packetSize) { int len = Udp.read(incomingPacket, 255); if (len > 0) incomingPacket[len] = 0; tft.fillRect(0, 100, 320, 40, TFT_BLACK); tft.setCursor(10, 100); tft.setTextSize(3); tft.setTextColor(TFT_GREEN); tft.printf("UDP: %s", incomingPacket); Serial.printf("Recibido: %s\n", incomingPacket); } }