diff --git a/include/TCP.h b/include/TCP.h index ccdbeca..ee11e42 100644 --- a/include/TCP.h +++ b/include/TCP.h @@ -26,7 +26,9 @@ class TCP { WiFiClient client; // WiFi client object TFT_eSPI* tft; const int w = 128; - const int h = 180; + const int h = 168; + uint8_t imageBuffer[128 * 168 * 3]; + uint16_t lineBuffer[128]; }; #endif // TCP_H diff --git a/src/TCP.cpp b/src/TCP.cpp index 0852fb0..dbe142d 100644 --- a/src/TCP.cpp +++ b/src/TCP.cpp @@ -27,6 +27,7 @@ void TCP::connectWiFi(TFT_eSPI& tf) { delay(1000); tft->println(WiFi.localIP()); delay(1000); + //client.setTimeout(100); } void TCP::testConnection(){ @@ -73,7 +74,7 @@ void TCP::sendData(float& potData, int& emoteIndex) { } void TCP::receiveImage() { - client.setTimeout(500); + //client.setTimeout(500); uint8_t* imageData = new uint8_t[w * h * 3]; // Allocate memory for a 64x80 image diff --git a/src/main.cpp b/src/main.cpp index bb5ca6a..224e580 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -133,7 +133,7 @@ void loop() { setupEmotion(emotionText); tcp.receiveImage(); drawText(emotionText, x); - delay(50); + }