You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm not quite sure I understand what @jgDev is suggesting... But from what I can see your code looks fine.

    About the only thing that could cause it is if your planChime function was defined in another function where you then defined chimeTimer I guess you could end up with multiple different chimeTimers

    The new Bangle.js v2 firmware also uses a different way of doing the buzz (using interrupts) so it's not prone to the issues 2v09 had where you could call clearInterval() with no arguments and stop the buzz from ending.

    Maybe you could try putting some print statements in there? Might give you more of an idea what's going on?

  • It's working if it is changed to:

    function planChime() {
      if (chimeTimer) {
        clearTimeout(chimeTimer);
      }
      chimeTimer = setTimeout(function() {
        Bangle.buzz().then(() => {
          setTimeout(function(){
             planChime();
          }, 2000);
          });
      }, 3600000 - (Date.now() % 3600000));
    }
    
About

Avatar for Gordon @Gordon started