AB01 Battery Level

Hi,

I am using this little board AB01 v1 to build the weather station from chrisys.

The code provides both BatteryVoltage and BatteryLevel

batteryVoltage = getBatteryVoltage();
batteryLevel = (BoardGetBatteryLevel() / 254) * 100;

The issue is that while I get the batteryVoltage perfectly fine. batteryLevel shows always 0.

I have been trying to locate BoradBatteryLevel() function/method and I have not found it. I only see a call to the following within LoraWanApp.cpp but I have no clue where the definition of BoardGetBatteryLevel is.

Any ideas would be really appreciated.

Thanks
JA

A very interesting function :grinning:

uint8_t BoardGetBatteryLevel( void )
{
  return 0;
}

located at …packages\Heltec-esp32\hardware\esp32\1.0.0\libraries\LoraWan102\src\driver\board.c

I think it will be the best to create an own function :wink:

I am laughing! Thanks because I didn’t find it.

I will do a simple. batt_voltage /4200 mah * 100 :slight_smile:

Thank you micha-pr. Amazing!