mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
ESP32 target
This commit is contained in:
@@ -16,21 +16,19 @@ class SensorAnalogClass : public SensorConvertingClass {
|
||||
}
|
||||
|
||||
int SensorAnalogRead(String key, String pin) {
|
||||
int pinInt = pin.toInt();
|
||||
int value;
|
||||
|
||||
#ifdef ESP32
|
||||
int pinInt = pin.toInt();
|
||||
value = analogRead(pinInt);
|
||||
#endif
|
||||
#ifdef ESP8266
|
||||
value = analogRead(A0);
|
||||
#endif
|
||||
|
||||
value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
Serial.println("I sensor '" + key + "' data: " + String(valueFl));
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user