2020-11-04 23:48:21 +03:00
|
|
|
#include "BufferExecute.h"
|
2020-09-03 01:12:43 +03:00
|
|
|
#include "items/SensorAnalogClass.h"
|
2020-09-02 23:37:11 +03:00
|
|
|
#ifdef ANALOG_ENABLED
|
|
|
|
|
//==============================================Модуль аналогового сенсора===========================================================================================
|
|
|
|
|
//===================================================================================================================================================================
|
2020-09-03 02:07:12 +03:00
|
|
|
SensorAnalogClass mySensorAnalog;
|
2020-09-02 23:37:11 +03:00
|
|
|
void analogAdc() {
|
2020-09-03 02:07:12 +03:00
|
|
|
mySensorAnalog.update();
|
|
|
|
|
String key = mySensorAnalog.gkey();
|
2020-09-02 23:37:11 +03:00
|
|
|
sCmd.addCommand(key.c_str(), analogReading);
|
2020-10-20 22:55:45 +03:00
|
|
|
sensorReadingMap10sec += key + ",";
|
2020-09-17 22:49:55 +03:00
|
|
|
mySensorAnalog.SensorAnalogInit();
|
2020-09-03 02:07:12 +03:00
|
|
|
mySensorAnalog.clear();
|
2020-09-02 23:37:11 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void analogReading() {
|
|
|
|
|
String key = sCmd.order();
|
|
|
|
|
String pin = jsonReadStr(configOptionJson, key + "_pin");
|
2020-09-03 02:07:12 +03:00
|
|
|
mySensorAnalog.SensorAnalogRead(key, pin);
|
2020-09-02 23:37:11 +03:00
|
|
|
}
|
|
|
|
|
#endif
|