I am trying to add the ability to get the battery voltage to the Tracker example. My intention is to add it to the radio payload so that I can monitor it at the ‘centre’.
To achieve this I have taken bits of the battery example and added them to my code.
At the moment I am just displaying the battery voltage in the serial monitor.
It initially appears to be working OK. Everything initialises and it starts the main loop - reads the accelerometer data and displays it; reads the voltage and displays it; reads the gps data and displays.
But it then just hangs.
If I comment out just the part that reads the voltage (below) it works normally.
// Get a raw ADC reading =======================================
// float vbat_mv = readVBAT();
// Serial.print(“LIPO = “);
// Serial.println(” mV”);