добавил класс сенсора и наследующий класс аналогового сенсора

This commit is contained in:
Dmitry Borisenko
2022-01-14 22:51:28 +01:00
parent e6e3497c40
commit 063e818c87
4 changed files with 43 additions and 11 deletions

23
src/Configuration.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "Configuration.h"
void configure(String& path) {
File file = seekFile(path);
while (file.available()) {
String jsonArrayElement = file.readStringUntil('}') + "}";
String subtype;
if (jsonRead(jsonArrayElement, F("subtype"), subtype)) {
if (subtype == F("button-out")) {
//=============================
} else if (subtype == F("pwm-out")) {
//=============================
} else if (subtype == F("analog-adc")) {
//iotSensors.push_back(IoTSensorAnalog(jsonArrayElement));
} else {
SerialPrint(F("E"), F("Config"), F("config.json error, type not exist"));
}
} else {
SerialPrint(F("E"), F("Config"), F("config.json error, type wrong or missing"));
}
}
file.close();
}