Best idea is to take 2x 1M Ohm resistors and connect them in series across the battery to create a potential divider. Then, just connect the middle to one of the analog inputs and the value you get will be 1/2 the battery voltage. If your battery is >6.6v you'll need to change the resistor values accordingly though :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
See the other post you made about the problem - it'll be fixed now, you just have to update the firmware again.
Reading vref works fine if you've removed the voltage regulator, but normally it'll just return 3.3v (ish) unless your battery gets really low.
Best idea is to take 2x 1M Ohm resistors and connect them in series across the battery to create a potential divider. Then, just connect the middle to one of the analog inputs and the value you get will be 1/2 the battery voltage. If your battery is >6.6v you'll need to change the resistor values accordingly though :)