Variant on "first app" - gym timer, in binary

Posted on
  • I've tweaked the example first app for something else that I wanted/needed - a 3 minute timer for my rest periods in the gym. Except I did it in binary for nerd cred and a random FB chat I was involved in.

    JS file attached, MIT licence as usual.

    • I think I've not got the button-press for reset registered entirely correctly, but putting that line anywhere else in the code made it not reset on countdown & out of time
    • next step would be throwing the reset time into the settings app - can anyone point me at the documentation for hooking up with settings? I'm failing at site navigtion.

    1 Attachment

  • 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/t­ree/master/apps/gbridge

    You just create a settings file in that format, and put it on the bangle as myapp.settings.js and you're done.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Variant on "first app" - gym timer, in binary

Posted by Avatar for jimr1603 @jimr1603

Actions