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.
30 lines
725 B
30 lines
725 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);
|
|
|
|
|
|
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;
|
|
};
|
|
|
|
#endif // TCP_H
|
|
|
|
|