1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

Fix for config pages with more values

This commit is contained in:
norbert-walter
2022-04-03 19:35:44 +02:00
parent 30437dddb6
commit a4e8b7217b
6 changed files with 189 additions and 61 deletions

View File

@@ -413,7 +413,15 @@ void sensorTask(void *param){
if(millis() > starttime8 + 1000 && (String(powsensor1) == "INA219" || String(powsensor1) == "INA226")){
starttime8 = millis();
if(String(powsensor1) == "INA226" && INA226_1_ready == true){
sensors.batteryVoltage = ina226_1.getBusVoltage();
double voltage = ina226_1.getBusVoltage();
// Limiter for voltage average building
if(voltage < -30){
voltage = -30;
}
if(voltage > 30){
voltage = 30;
}
sensors.batteryVoltage = voltage;
sensors.batteryCurrent = ina226_1.getCurrent() * corrFactor;
// Eliminates bit jitter by zero current values
float factor = maxCurrent / 100;