The default value is 32000 (what ST say the internal clock speed should be) but let's say you're getting 0.923 average running that code above, you'd do:
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.
Ok, fixed it. If you flash a build from http://www.espruino.com/binaries/travis/36e263aabe91be08ebaf60ef1960807963e2130e then it'll have a function called
E.setRTCPrescaler
.The default value is 32000 (what ST say the internal clock speed should be) but let's say you're getting
0.923
average running that code above, you'd do:It'll take a few seconds to stabilise, and you might need to do some fiddling to get it a bit more accurate, but that should help you out a lot.
If it looks like it's something useful I'll see about getting it into the main branch of Espruino.