This commit is contained in:
lexa
2020-11-19 20:53:01 +03:00
parent 279e09334f
commit f198dc1b95
2 changed files with 29 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ void setup() {
analogReference(INTERNAL);
sensorValue = analogRead(BATTERY_SENSE_PIN);
v = sensorValue * 0.004659498;
batteryPcnt = (v * 100) / 4.2;
batteryPcnt = (v-3.0 * 100) / 1.2;
while (myAHT10.begin() != true)
{
Serial.println(F("AHT10 not connected or fail to load calibration coefficient")); //(F()) save string to flash & keeps dynamic memory free
@@ -53,7 +53,7 @@ void loop() {
send(msgMillis.set(cRun));
sensorValue = analogRead(BATTERY_SENSE_PIN);
v = sensorValue * 0.004659498;
batteryPcnt = (v-3 * 100) / 1.2;
batteryPcnt = (v-3.0 * 100) / 1.2;
sendBatteryLevel(batteryPcnt);
send(msgVolts.set(v, 2));
//}