1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 06:53:07 +01:00
This commit is contained in:
norbert-walter
2022-04-18 17:22:24 +02:00
parent 9a20e589da
commit 662dd5e0e2
5 changed files with 270 additions and 24 deletions

View File

@@ -9,7 +9,6 @@ class PageBattery2 : public Page
bool init = false; // Marker for init done
bool keylock = false; // Keylock
int average = 0; // Average type [0...3], 0=off, 1=10s, 2=60s, 3=300s
bool trend = true; // Trend indicator [0|1], 0=off, 1=on
double raw = 0;
public:
@@ -24,12 +23,6 @@ public:
return 0; // Commit the key
}
// Trend indicator
if(key == 5){
trend = !trend;
return 0; // Commit the key
}
// Code for keylock
if(key == 11){
keylock = !keylock; // Toggle keylock
@@ -79,9 +72,6 @@ public:
valueTrend = commonData.data.batteryVoltage10;
}
// Get raw value for trend indicator
raw = commonData.data.batteryVoltage; // Live data
// Switch average values
switch (average) {
case 0:
@@ -281,11 +271,18 @@ public:
display.print("h");
// Show sensor type info
String i2cAddr = "";
display.setFont(&Ubuntu_Bold8pt7b);
display.setCursor(270, 60);
if(powerSensor == "off") display.print("Internal");
if(powerSensor == "INA219") display.print("INA219");
if(powerSensor == "INA226") display.print("INA226");
if(powerSensor == "INA219"){
display.print("INA219");
}
if(powerSensor == "INA226"){
display.print("INA226");
i2cAddr = " (0x" + String(INA226_I2C_ADDR1, HEX) + ")";
}
display.print(i2cAddr);
display.setCursor(270, 80);
display.print("Sensor Modul");