From 42b8d64c0dfad29b3ce0288ea943ade9c9c804dc Mon Sep 17 00:00:00 2001 From: lexa Date: Thu, 19 Nov 2020 21:23:01 +0300 Subject: [PATCH] Msg --- ExtSens/src/main.cpp | 2 +- VT_ESP8266/platformio.ini | 7 ++++--- VT_ESP8266/src/main.cpp | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ExtSens/src/main.cpp b/ExtSens/src/main.cpp index e771935..7d0af8a 100644 --- a/ExtSens/src/main.cpp +++ b/ExtSens/src/main.cpp @@ -53,7 +53,7 @@ void loop() { send(msgMillis.set(cRun)); sensorValue = analogRead(BATTERY_SENSE_PIN); v = sensorValue * 0.004659498; - batteryPcnt = (v-3.0 * 100) / 1.2; + batteryPcnt = ((v-3.0) * 100) / 1.2; sendBatteryLevel(batteryPcnt); send(msgVolts.set(v, 2)); //} diff --git a/VT_ESP8266/platformio.ini b/VT_ESP8266/platformio.ini index c1b8d2a..4f42a90 100644 --- a/VT_ESP8266/platformio.ini +++ b/VT_ESP8266/platformio.ini @@ -16,6 +16,7 @@ monitor_speed = 115200 upload_protocol = espota upload_port = 192.168.1.134 lib_deps = - # RECOMMENDED - # Accept new functionality in a backwards compatible manner and patches - closedcube/ClosedCube HDC1080 @ ^1.3.2 \ No newline at end of file + closedcube/ClosedCube HDC1080 @ ^1.3.2 + mathertel/RotaryEncoder @ ^1.3.0 + robtillaart/PCF8574 @ ^0.2.1 + robtillaart/I2C_EEPROM @ ^1.3.0 diff --git a/VT_ESP8266/src/main.cpp b/VT_ESP8266/src/main.cpp index 857bff6..91808b0 100644 --- a/VT_ESP8266/src/main.cpp +++ b/VT_ESP8266/src/main.cpp @@ -653,8 +653,13 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties ee.writeBlock(8, (uint8_t*)&wUstavki, sizeof(wCounter)); itoa(wUstavki.hDB, v, 10); mqttClient.publish("/home/vt/hdb", 1, false, v); + } else + if(strcmp(topic, "/home/vt/flood") == 0){ + pcf.write(LED_RED, !atoi(payload)); + c_flood = atoi(payload); } } + void onMqttPublish(uint16_t packetId) { //Serial1.println("Publish acknowledged."); //Serial1.print(" packetId: ");