Browse Source

final update

master
Cailean Finn 2 months ago
parent
commit
94709f6c61
  1. 4
      include/TCP.h
  2. 3
      src/TCP.cpp
  3. 2
      src/main.cpp

4
include/TCP.h

@ -26,7 +26,9 @@ class TCP {
WiFiClient client; // WiFi client object WiFiClient client; // WiFi client object
TFT_eSPI* tft; TFT_eSPI* tft;
const int w = 128; 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 #endif // TCP_H

3
src/TCP.cpp

@ -27,6 +27,7 @@ void TCP::connectWiFi(TFT_eSPI& tf) {
delay(1000); delay(1000);
tft->println(WiFi.localIP()); tft->println(WiFi.localIP());
delay(1000); delay(1000);
//client.setTimeout(100);
} }
void TCP::testConnection(){ void TCP::testConnection(){
@ -73,7 +74,7 @@ void TCP::sendData(float& potData, int& emoteIndex) {
} }
void TCP::receiveImage() { void TCP::receiveImage() {
client.setTimeout(500); //client.setTimeout(500);
uint8_t* imageData = new uint8_t[w * h * 3]; // Allocate memory for a 64x80 image uint8_t* imageData = new uint8_t[w * h * 3]; // Allocate memory for a 64x80 image

2
src/main.cpp

@ -133,7 +133,7 @@ void loop() {
setupEmotion(emotionText); setupEmotion(emotionText);
tcp.receiveImage(); tcp.receiveImage();
drawText(emotionText, x); drawText(emotionText, x);
delay(50);
} }

Loading…
Cancel
Save