Threshold odczytu poziomu baterii

This commit is contained in:
sieja
2025-02-22 20:05:42 +01:00
parent d05858b684
commit bd18957704

View File

@@ -9,7 +9,7 @@
#include "SD.h" #include "SD.h"
#include "SPI.h" #include "SPI.h"
#define Version "0.29" #define Version "0.30"
#define WIRE Wire #define WIRE Wire
#define DHTTYPE DHT22 #define DHTTYPE DHT22
#define DHTPIN 4 #define DHTPIN 4
@@ -440,7 +440,7 @@ void loop() {
// Log napiećia docelowoe procent baterii // Log napiećia docelowoe procent baterii
// kiedy zaden przycisk nie jest wcisniety // kiedy zaden przycisk nie jest wcisniety
if (abs (batteryVoltage - currentBatteryVoltage) >= 0.2 && digitalRead(BTN_DOWN) == LOW && digitalRead(BTN_UP) == LOW && digitalRead(BTN_ENTER) == LOW ) { if (abs (batteryVoltage - currentBatteryVoltage) >= 0.14 && digitalRead(BTN_DOWN) == LOW && digitalRead(BTN_UP) == LOW && digitalRead(BTN_ENTER) == LOW ) {
lastBatteryVoltage = currentBatteryVoltage; lastBatteryVoltage = currentBatteryVoltage;
currentBatteryVoltage = batteryVoltage; currentBatteryVoltage = batteryVoltage;
} }