Great! I think that's fine... By default setWatch only calls the function once, but you can have more than one setWatch active on a button at once.
Maybe the best option is to put setWatch(function, button, {repeat:true}) right at the end of your code outside the function, then you have something that is called whenever you press a button, and in the function that's called you work out what to 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.
Great! I think that's fine... By default
setWatch
only calls the function once, but you can have more than one setWatch active on a button at once.Maybe the best option is to put
setWatch(function, button, {repeat:true})
right at the end of your code outside the function, then you have something that is called whenever you press a button, and in the function that's called you work out what to do?I don't think there is a tutorial for settings at the moment - but I'll have a go at getting one done later today. If you want to get started quick I'd look at gadgetbridge as an example: https://github.com/espruino/BangleApps/tree/master/apps/gbridge
You just create a
settings
file in that format, and put it on the bangle asmyapp.settings.js
and you're done.