mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
251 fixed ultrasonic bug
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "LittleFS version: 250"
|
||||
"title": "LittleFS version: 251"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
//=================Firmeare=================
|
||||
#define FIRMWARE_NAME "esp8266-iotm"
|
||||
#define FIRMWARE_VERSION 250
|
||||
#define FIRMWARE_VERSION 251
|
||||
#define FLASH_4MB true
|
||||
|
||||
//=================System===================
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "Class/LineParsing.h"
|
||||
#include "Global.h"
|
||||
#include "items/SensorConvertingClass.h"
|
||||
@@ -11,6 +12,8 @@ class SensorUltrasonic : public SensorConvertingClass {
|
||||
sensorReadingMap += _key + ",";
|
||||
String trig = selectFromMarkerToMarker(_pin, ",", 0);
|
||||
String echo = selectFromMarkerToMarker(_pin, ",", 1);
|
||||
pinMode(trig.toInt(), OUTPUT);
|
||||
pinMode(echo.toInt(), INPUT);
|
||||
jsonWriteStr(configOptionJson, _key + "_trig", trig);
|
||||
jsonWriteStr(configOptionJson, _key + "_echo", echo);
|
||||
jsonWriteStr(configOptionJson, _key + "_map", _map);
|
||||
@@ -34,7 +37,7 @@ class SensorUltrasonic : public SensorConvertingClass {
|
||||
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));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user