PlatformIO implementation for stubborn vectors. Includes TFT display & TCP code to connect and send data from a potentiometer to an OpenFrameworks application using the ofxNetwork library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
808 B

#ifndef TCP_H
#define TCP_H
#include <WiFi.h>
#include <WiFiClient.h>
#include <TFT_eSPI.h>
#include <SPI.h>
class TCP {
public:
// Constructor
TCP(const char* ssid, const char* password, const char* host, uint16_t port);
// Methods to connect to WiFi and send data
void connectWiFi(TFT_eSPI& tft);
void testConnection();
void sendData(float& potData, int& emoteIndex);
void receiveImage();
private:
const char* ssid; // WiFi SSID
const char* password; // WiFi password
const char* host; // Host IP address
uint16_t port; // Port number
WiFiClient client; // WiFi client object
TFT_eSPI* tft;
const int w = 128;
const int h = 180;
};
#endif // TCP_H