diff --git a/SDP600Sensor/inc/PressureWrapper.h b/SDP600Sensor/inc/PressureWrapper.h new file mode 100644 index 0000000..e69de29 diff --git a/esp-vent-main/src/PressureWrapper.cpp b/SDP600Sensor/src/PressureWrapper.cpp similarity index 100% rename from esp-vent-main/src/PressureWrapper.cpp rename to SDP600Sensor/src/PressureWrapper.cpp diff --git a/StateHandler/inc/StateHandler.h b/StateHandler/inc/StateHandler.h index 50e2a9c..7d014f9 100644 --- a/StateHandler/inc/StateHandler.h +++ b/StateHandler/inc/StateHandler.h @@ -21,6 +21,8 @@ #include "LiquidCrystal.h" #include "ModbusMaster.h" #include "ModbusRegister.h" +#include "GMP252.h" +#include "HMP60.h" /** Buttons enumeration * @@ -118,6 +120,12 @@ private: LiquidCrystal *_lcd; ModbusRegister *A01; + /* CO2 sensor object */ + GMP252 co2; + + /* Humidity and temperature sensor object */ + HMP60 humidity; + /** Initialization state * * @param event event of the state diff --git a/StateHandler/src/StateHandler.cpp b/StateHandler/src/StateHandler.cpp index 9fc2258..884d2bd 100644 --- a/StateHandler/src/StateHandler.cpp +++ b/StateHandler/src/StateHandler.cpp @@ -139,6 +139,8 @@ StateHandler::stateAuto (const Event &event) // this->A01->write(fan_speed.getCurrent()); if(saved_curr_value[AUTO] < saved_set_value[AUTO]) { fan_speed.inc(); + while(i<720) i++; + i = 0; this->A01->write(fan_speed.getCurrent()); } else if(saved_curr_value[AUTO] > saved_set_value[AUTO]){ fan_speed.dec(); @@ -150,6 +152,7 @@ StateHandler::stateAuto (const Event &event) } } + void StateHandler::handleControlButtons (uint8_t button) { diff --git a/esp-vent-main/src/PressureWrapper.h b/esp-vent-main/src/PressureWrapper.h deleted file mode 100644 index 6ee2936..0000000 --- a/esp-vent-main/src/PressureWrapper.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * PressureWrapper.h - * - * Created on: 5 Oct 2022 - * Author: evgenymeshcheryakov - */ - -#ifndef PRESSUREWRAPPER_H_ -#define PRESSUREWRAPPER_H_ - -#include "I2C.h" -#include - -#define ADDRESS 0x40 - - -/** - * @brief structure to hold a raw data from - * the pressure sensor - */ - -typedef struct _PRESSURE{ - uint8_t rBuffer[2]; - uint8_t crc; -}PRESSURE_DATA; - -class PressureWrapper -{ -public: - PressureWrapper (); - /* - * @return pressure in Pascal - */ - int getPressure (); - - virtual ~PressureWrapper (); - -private: - I2C *i2c; - PRESSURE_DATA data = {{0, 0}, 0}; - /* - * @return struct with pressure data in - * rBuffer and CRC check in crc - */ - bool getRawPressure (); -}; - -#endif /* PRESSUREWRAPPER_H_ */