2022-01-14 20:22:52 +01:00
|
|
|
#include "Config.h"
|
|
|
|
|
|
2022-01-14 20:42:11 +01:00
|
|
|
void configure(String& path) {
|
|
|
|
|
File file = seekFile(path);
|
|
|
|
|
while (file.available()) {
|
|
|
|
|
String jsonArrayElement = file.readStringUntil('}') + "}";
|
|
|
|
|
String value;
|
|
|
|
|
if (jsonRead(jsonArrayElement, F("subtype"), value)) {
|
|
|
|
|
if (value == F("button-out")) {
|
|
|
|
|
//=============================
|
|
|
|
|
} else if (value == F("pwm-out")) {
|
|
|
|
|
//=============================
|
2022-01-14 21:48:43 +01:00
|
|
|
} else if (value == F("analog-adc")) {
|
|
|
|
|
//=============================
|
2022-01-14 20:47:24 +01:00
|
|
|
} else {
|
|
|
|
|
SerialPrint(F("E"), F("Config"), F("config.json error, type not exist"));
|
2022-01-14 20:42:11 +01:00
|
|
|
}
|
|
|
|
|
} else {
|
2022-01-14 20:47:24 +01:00
|
|
|
SerialPrint(F("E"), F("Config"), F("config.json error, type wrong or missing"));
|
2022-01-14 20:42:11 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
file.close();
|
2022-01-14 20:22:52 +01:00
|
|
|
}
|