Avatar for RickyP

RickyP

Member since Nov 2021 • Last active Dec 2021
  • 2 conversations
  • 6 comments

Most recent activity

  • in Bangle.js
    Avatar for RickyP

    Thanks for your help and the code example, I've now got the basics working.
    I've added some coloured bars but this is what I've written.

    function getSteps() {
    if (WIDGETS.wpedom !== undefined) {

    return WIDGETS.wpedom.getSteps();
    

    }
    return '????';
    }

    g.clear(); // Clear the screen once, at startup

    // Load widgets
    Bangle.loadWidgets();

    //Set background
    // top box
    g.setColor("#00f"); //blue
    g.fillRect(0, 0, 176, 58);
    // middle box
    g.setColor("#ff0"); //yellow
    g.fillRect(0, 60, 176, 118);
    // bottom box
    g.setColor("#f00"); //red
    g.fillRect(0, 120, 176, 176);

    //Draw text string
    g.setFontAlign(0, 0).setFont("Vector", 55);
    g.drawString(getSteps(), 90, 95);

  • in Bangle.js
    Avatar for RickyP

    Yes, a health tracking app is installed and I can see the number of steps as a graph.
    These are the health files on the Bangle2.

  • in Bangle.js
    Avatar for RickyP

    Thanks, I've made the changes to my code but get an error "module health not found" even after I've loaded the health tracking widget.
    Going to play around with it some more and try and find out what's happening.

    Thanks.

  • in Bangle.js
    Avatar for RickyP

    Hello everyone,
    2 questions

    I've written my own clock face and added a daily step count to the screen by using Bangle.getStepCount() but this just seems to just keep incrementing and not resetting to zero at the start of each day.

    Should it reset to zero?

    I've loaded the Pedometer widget, which does seem to reset but any suggestions on how I might use that step count on the screen rather than as a widget?

  • in Bangle.js
    Avatar for RickyP

    Gordon, thank you for the quick reply and explanation.

    Rick

    • 3 comments
    • 698 views
  • in Bangle.js
    Avatar for RickyP

    Hi, I've written my own clock app and have a background image that I'm adding the time and date on top of, however, whenever the time updates the background for the text "box" becomes white and coversthat part of the image.
    This is when I use 'true' as the 4th argument to drawString, if I change it to 'false' the image is shown properly but overtime the time become 88:88. I've got around it by clearing the screen and rewriting the image and text every time the screen is updated.
    In the clock example (https://www.espruino.com/Bangle.js+Clock­) it says that 'true', by default, only redraws the text, so I was expecting the background image to still fill the screen.
    Is there something I've missed, when using drawString or do I have to stick with my workaround?

    Rick

Actions