@Algram There is a nice and simple way to measure the battery voltage which does not waste power. The method uses the fact that the digital outputs of the processor for a logical 1 go up practically to almost the Vcc voltage.
So what you do: you assign one digital output. You connect a resistor bridge that brings the voltage down to -say- one 1/4th (if your battery is 3.6V), and the output of that resistor bridge is connected to an analogue input, where you use the ADC to sample the voltage using the internal 1.1 Volt reference (!) as reference. Voila! Important is that the resistor bridge brings the battery voltage below the 1.1 Volt reference of course.
In your sketch you set the digital output to 1 when you want to do a measurement, you do one AD-conversion (or several, if you’d like to average), and then you set the digital output back to 0, so the circuit uses zero power when you are not measuring.
In our devices, we actually measure the battery voltage when the RFM is transmitting, because that is the maximum stress for the battery. So we send the TX-opcode to the RFM, wait for the RFM to start transmitting (typically takes several milliseconds), and then sample the battery voltage.
Hope this helps! If you implement this idea, you may donate me one can of Coca Cola Zero