...I see your cycle consuming wait(n /*ms*/) function invocations... did ou think of an alternatives?... because this is kind of blocking the JS thread completely when the 500ms interval'd code runs.
I know, it is not easy to inverse a function... and make it with multiple entry/resume points... but it should be possible... May be for this case it is not worth the effort.
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.
...I see your cycle consuming
wait(n /*ms*/)
function invocations... did ou think of an alternatives?... because this is kind of blocking the JS thread completely when the 500ms interval'd code runs.I know, it is not easy to inverse a function... and make it with multiple entry/resume points... but it should be possible... May be for this case it is not worth the effort.