• Hi! There's actually a pedometer built into Bangle.js - I believe Active Pedometer was an attempt to get better step recording than is done by the default firmware, and you might find the 'normal' pedometer a bit cleaner: https://github.com/espruino/BangleApps/b­lob/master/apps/widpedom/widget.js

    However obviously getting elapsed steps is a bit more tricky.

    I'd suggest going with modules if you want a nice tidy solution. As an example, look at gbridge:

    • gbridge uses notifications and adds "dependencies": { "notify":"type" }, to its JSON
    • Both notify and notifyfs implement notify, and have "type": "notify", in their JSON
    • When you install gbridge the app loader checks if you already have an app of type notify, and if not it installs the first one

    So you could do this for the pedometer, then you'd be able to switch out the code you used for step counting and all apps would then use that - plus you wouldn't have to access files directly.

    Having said that, the best solution here would be to get Bangle.js's built-in step counting to a point where everyone was happy just to use that (there's an issue open for it at https://github.com/espruino/Espruino/iss­ues/1846). I guess maybe keeping track of the amount of steps per day could be built in too.

  • Thanks Gordon. Nice to interact with you. Massive thanks for getting this product / concept to market fantastic achievement.

    I did originally try the /widpedom/widget.js but found the numbers in the widget display rather small. I then attempted just the edit the widget.js file and upload to storage, but should have followed the setup your own App store via github mechanism.

    The current step count is stored in stp_today and was not sure if this is a global variable so I could access from another App.

    I tried >stp_today in the IDE and got undefined. I wonder if all I would need to do is create a getTodaysSteps() function in the widget and that would give me the ability to grab what I need for a larger display of the count.

About

Avatar for HughB @HughB started