This commit is contained in:
lexa
2020-11-19 21:23:01 +03:00
parent f198dc1b95
commit 42b8d64c0d
3 changed files with 10 additions and 4 deletions

View File

@@ -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));
//}

View File

@@ -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
closedcube/ClosedCube HDC1080 @ ^1.3.2
mathertel/RotaryEncoder @ ^1.3.0
robtillaart/PCF8574 @ ^0.2.1
robtillaart/I2C_EEPROM @ ^1.3.0

View File

@@ -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: ");