Files
J1B3-Sensor-boxes/arduino/node-code/nodeCodeFinal/nodeCodeHeader.h
Dano van den Bosch ec336f914a removed unjused code
2024-03-20 12:40:55 +01:00

55 lines
990 B
C++

#ifndef nodeReading_h
#define nodeReading_h
#include <Wire.h>
#include <Adafruit_SH110X.h>
#include <DHT.h>
#include <Adafruit_SGP30.h>
#include "websockets.h"
// define pins on esp32
#define MICPIN 6
#define DHTPIN 7
#define SCL 9
#define SDA 8
#define DHTTYPE DHT11
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define i2c_adress 0x3c
#define OLED_RESET -1 // QT-PY / XIAO
#define USE_SERIAL Serial
class nodeReadings
{
public:
nodeReadings();
void setup();
void loop();
void resetValues();
void update();
void checkForError();
void displayData();
private:
DHT *dht;
Adafruit_SH1106G *display;
websockets *webSocket;
Adafruit_SGP30 *sgp;
uint16_t TVOC_base, eCO2_base;
uint16_t counter;
uint16_t eCO2;
uint16_t TVOC;
uint16_t interval;
float temperature;
float humidity;
unsigned long currentMillis;
unsigned long lastMillis;
bool errorSGP30;
bool errorDHT11;
bool noise;
};
#endif