added batteryPin for QRPLabs LT P1_0

This commit is contained in:
richonguzman 2024-10-24 14:55:00 -03:00
parent 686874b8c0
commit 522503083e
2 changed files with 4 additions and 0 deletions

View File

@ -282,6 +282,7 @@
#define GPS_TX 18
#define GPS_VCC 33 //#define LED_PIN 16
#define BUTTON_PIN 0
#define BATTERY_PIN 1
#define RADIO_VCC_PIN 21
#define RADIO_SCLK_PIN 12
#define RADIO_MISO_PIN 13

View File

@ -74,6 +74,9 @@ namespace POWER_Utils {
batteryMeasurmentTime = millis();
#endif
double voltage = (adc_value * 3.3 ) / 4095.0;
#ifdef LIGHTTRACKER_PLUS_1_0
return voltage * 6.783;
#endif
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_GPS_915) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(TTGO_T_LORA32_V2_1_TNC_915) || defined(ESP32_DIY_LoRa_GPS) || defined(ESP32_DIY_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(ESP32_DIY_1W_LoRa_GPS_915) || defined(ESP32_DIY_1W_LoRa_GPS_LLCC68) || defined(OE5HWN_MeshCom) || defined(TTGO_T_DECK_GPS) || defined(TTGO_T_DECK_PLUS) || defined(ESP32S3_DIY_LoRa_GPS) || defined(ESP32S3_DIY_LoRa_GPS_915)
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