As it is a watch, how about having Bangle emit time events?
Bangle.on('hour', function(time) {
// time is a Date object
// fires exactly once per hour, with minutes/seconds/milliseconds = 0
})
Bangle.on('minute', function(time) {
// time is a Date object
// fires exactly once per minute, with seconds/milliseconds = 0
})
Bangle.on('second', function(time) {
// time is a Date object
// fires exactly once per second, with milliseconds = 0
})
At least for buzzing every hour or redrawing clocks this should be sufficient to get rid of manually setting timeouts/intervals.
No idea if this would have a serious impact on performance/battery life though (especially for the V1, where clocks tend to clear their timeouts when the LCD is off)
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.
As it is a watch, how about having
Bangle
emit time events?At least for buzzing every hour or redrawing clocks this should be sufficient to get rid of manually setting timeouts/intervals.
No idea if this would have a serious impact on performance/battery life though (especially for the V1, where clocks tend to clear their timeouts when the LCD is off)