Интегрируем датчик SHT20 в основные фалы проекта кроме set.device.json

This commit is contained in:
2021-12-03 10:30:56 +03:00
parent 55ee70849f
commit de2075664b
5 changed files with 23 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
#include "items/vPwmOut.h"
#include "items/vSensorAnalog.h"
#include "items/vSensorBme280.h"
#include "items/vSensorSht20.h"
#include "items/vSensorBmp280.h"
#include "items/vSensorCcs811.h"
#include "items/vSensorDallas.h"
@@ -110,6 +111,10 @@ void csvCmdExecute(String& cmdStr) {
} else if (order == F("bme280")) {
#ifdef EnableSensorBme280
sCmd.addCommand(order.c_str(), bme280Sensor);
#endif
} else if (order == F("sht20")) {
#ifdef EnableSensorSht20
sCmd.addCommand(order.c_str(), sht20Sensor);
#endif
} else if (order == F("bmp280")) {
#ifdef EnableSensorBmp280

View File

@@ -13,6 +13,7 @@
#include "items/vPwmOut.h"
#include "items/vSensorAnalog.h"
#include "items/vSensorBme280.h"
#include "items/vSensorSht20.h"
#include "items/vSensorBmp280.h"
#include "items/vSensorCcs811.h"
#include "items/vSensorDallas.h"
@@ -187,6 +188,11 @@ void clearVectors() {
mySensorBme280->clear();
}
#endif
#ifdef EnableSensorSht20
if (mySensorSht20 != nullptr) {
mySensorSht20->clear();
}
#endif
#ifdef EnableSensorBmp280
if (mySensorBmp280 != nullptr) {
mySensorBmp280->clear();

View File

@@ -25,6 +25,7 @@
#include "items/vLogging.h"
#include "items/vSensorAnalog.h"
#include "items/vSensorBme280.h"
#include "items/vSensorSht20.h"
#include "items/vSensorBmp280.h"
#include "items/vSensorCcs811.h"
#include "items/vSensorDallas.h"
@@ -173,6 +174,13 @@ void loop() {
}
}
#endif
#ifdef EnableSensorSht20
if (mySensorSht20 != nullptr) {
for (unsigned int i = 0; i < mySensorSht20->size(); i++) {
mySensorSht20->at(i).loop();
}
}
#endif
#ifdef EnableSensorBmp280
if (mySensorBmp280 != nullptr) {
for (unsigned int i = 0; i < mySensorBmp280->size(); i++) {