• I would recommend this as the best way to get the daily step count into a clock.

    I would not recommend getting it from the health app as it might take a day before you get a count for a whole day.

    function getSteps() {
      if (WIDGETS.wpedom !== undefined) {
        return WIDGETS.wpedom.getSteps();
      }
      return '????';
    }
    

    Yes, the daily step count should reset each day at midnight, both in the health app and the pedometer widget.

  • 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);

About

Avatar for HughB @HughB started