mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
GY21: Уточняем признак получения не верных показаний
This commit is contained in:
@@ -21,7 +21,7 @@ class GY21t : public IoTItem {
|
|||||||
// wire->read();
|
// wire->read();
|
||||||
value.valD = sensor->GY21_Temperature();
|
value.valD = sensor->GY21_Temperature();
|
||||||
if (value.valD < 300)
|
if (value.valD < 300)
|
||||||
regEvent(value.valD, "GY21"); // TODO: найти способ понимания ошибки получения данных
|
regEvent(value.valD, "GY21");
|
||||||
else
|
else
|
||||||
SerialPrint("E", "Sensor GY21t", "Error", _id);
|
SerialPrint("E", "Sensor GY21t", "Error", _id);
|
||||||
}
|
}
|
||||||
@@ -36,8 +36,8 @@ class GY21h : public IoTItem {
|
|||||||
void doByInterval() {
|
void doByInterval() {
|
||||||
// sht->read();
|
// sht->read();
|
||||||
value.valD = sensor->GY21_Humidity();
|
value.valD = sensor->GY21_Humidity();
|
||||||
if (value.valD != 0)
|
if (value.valD > 0)
|
||||||
regEvent(value.valD, "GY21h"); // TODO: найти способ понимания ошибки получения данных
|
regEvent(value.valD, "GY21h");
|
||||||
else
|
else
|
||||||
SerialPrint("E", "Sensor GY21h", "Error", _id);
|
SerialPrint("E", "Sensor GY21h", "Error", _id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user