removed unjused code
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
// #include <arduino.h>
|
||||
#include "nodeCodeHeader.h"
|
||||
// #include <DHT.h>
|
||||
// #include <Adafruit_SH110X.h>
|
||||
|
||||
|
||||
nodeReadings::nodeReadings() {
|
||||
|
||||
dht = new DHT(DHTPIN, DHTTYPE);
|
||||
display = new Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
||||
|
||||
// webSocket = new WebSocketsClient();
|
||||
webSocket = new websockets(); //nu naar eigen class
|
||||
sgp = new Adafruit_SGP30();
|
||||
|
||||
interval = 5000;
|
||||
resetValues();
|
||||
|
||||
}
|
||||
@@ -31,9 +26,6 @@ void nodeReadings::resetValues() {
|
||||
}
|
||||
|
||||
void nodeReadings::setup(){
|
||||
// DHT dht(DHTPIN, DHTTYPE);
|
||||
|
||||
|
||||
// make serial connection at 115200 baud
|
||||
Serial.begin(115200);
|
||||
|
||||
@@ -50,9 +42,6 @@ void nodeReadings::setup(){
|
||||
|
||||
webSocket->websocketSetup();
|
||||
|
||||
// webSocketClass.websocketSetup();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void nodeReadings::loop() {
|
||||
@@ -74,7 +63,6 @@ void nodeReadings::update(){
|
||||
// display sensordata on oled screen
|
||||
displayData();
|
||||
|
||||
// webSocket->sendTXT("{\"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp->eCO2) + "\",\"TVOC\":\"" + String(sgp->TVOC) + "\"}");
|
||||
webSocket->sendMyText("{\"node\": \"" + String(WiFi.macAddress()) + "\", \"Temp\":\"" + String(temperature) + "\",\"Humi\":\"" + String(humidity) + "\",\"eCO2\":\"" + String(sgp->eCO2) + "\",\"TVOC\":\"" + String(sgp->TVOC) + "\"}");
|
||||
|
||||
sgp->getIAQBaseline(&eCO2_base, &TVOC_base);
|
||||
@@ -92,13 +80,13 @@ void nodeReadings::displayData() {
|
||||
display->clearDisplay();
|
||||
|
||||
// display the data on the oled screen
|
||||
display->setTextSize(1);
|
||||
display->setTextSize(2);
|
||||
display->setTextColor(SH110X_WHITE);
|
||||
display->setCursor(0,0);
|
||||
display->println("Temperature: " + String(temperature) + " C");
|
||||
display->println("Humidity: " + String(humidity) + " %");
|
||||
display->println("eCO2: " + String(sgp->eCO2) + " ppm");
|
||||
display->println("TVOC: " + String(sgp->TVOC) + " ppb");
|
||||
display->println("Temp: " + String(int(temperature)) + " C");
|
||||
display->println("Humi: " + String(int(humidity)) + " %");
|
||||
display->println("eCO2: " + String(sgp->eCO2));// + " ppm");
|
||||
display->println("TVOC: " + String(sgp->TVOC));// + " ppb");
|
||||
display->display();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user