TDECK battery readings fix

This commit is contained in:
richonguzman 2024-05-13 19:03:27 -04:00
parent a04d49fb14
commit 75fee2f42b
3 changed files with 5 additions and 5 deletions

View File

@ -592,7 +592,7 @@ namespace MENU_Utils {
if (POWER_Utils::getBatteryInfoIsConnected()) {
String batteryVoltage = POWER_Utils::getBatteryInfoVoltage();
String batteryCharge = POWER_Utils::getBatteryInfoCurrent();
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER)
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(TTGO_T_DECK_GPS)
sixthRowMainMenu = "Bat: " + batteryVoltage + "V";
#endif
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)

View File

@ -185,11 +185,11 @@
#ifdef TTGO_T_DECK_GPS
#define GPS_RX 43
#define GPS_TX 44
#define BOARD_I2C_SDA 18
#define BOARD_I2C_SCL 8
#define BOARD_POWERON 10
#define BOARD_SDCARD_CS 39
#define BATTERY_PIN 4
#define BOARD_I2C_SDA 18
#define BOARD_I2C_SCL 8
#define RADIO_SCLK_PIN 40
#define RADIO_MISO_PIN 38
#define RADIO_MOSI_PIN 41

View File

@ -69,7 +69,7 @@ namespace POWER_Utils {
batteryMeasurmentTime = millis();
#endif
double voltage = (adc_value * 3.3 ) / 4095.0;
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom)
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS)
return (2 * (voltage + 0.1)) * (1 + (lora32BatReadingCorr/100)); // (2 x 100k voltage divider) 2 x voltage divider/+0.1 because ESP32 nonlinearity ~100mV ADC offset/extra correction
#endif
#if defined(HELTEC_V3_GPS) || defined(HELTEC_WIRELESS_TRACKER) || defined(ESP32_C3_DIY_LoRa_GPS)