#include #include #include #include "sensirion_common.h" #include "sgp30.h" #define WIFISSID "REDACTED" // Put your WifiSSID here #define PASSWORD "REDACTED" // Put your wifi password here #define TOKEN "REDACTED" // Put your Ubidots' TOKEN #define VARIABLE_LABEL1 "voc" // Assign the variable label #define VARIABLE_LABEL2 "co2" #define DEVICE_LABEL "co2-monitor-device" // Assign the device label #define MQTT_CLIENT_NAME "REDACTED" // MQTT client Name const long interval = 100; unsigned long previousMillis = 0; char mqttBroker[] = "industrial.api.ubidots.com"; WiFiClient wifiClient; PubSubClient client(wifiClient); TFT_eSPI tft = TFT_eSPI(); static unsigned short int VOC = 0; static unsigned short int CO2 = 0; // Space to store values to send char str_voc[6]; char str_co2[6]; char payload[700]; char topic[150]; void callback(char* topic, byte* payload, unsigned int length){ Serial.print("Message arrived ["); Serial.print(topic); Serial.print("] "); for (int i=0;i