• hi,
    i would sometimes like to reboot the bangle v2 using app, without using the button.

    i asked GPT4 for this code:

    (function() {
      function reboot() {
        E.reboot();
      }
    
      Bangle.on('lcdPower', function(on) {
        if (on) {
          Bangle.setLCDMode('on');
          reboot();
        }
      });
    
      // Draw a user interface if needed, or execute reboot directly
      g.clear();
      g.setFontAlign(0, 0); // center alignment
      g.setFont("Vector", 20);
      g.drawString("Rebooting...", g.getWidth() / 2, g.getHeight() / 2);
      setTimeout(reboot, 2000); // Execute reboot after 2 seconds for the user to read the screen
    })();
    

    it worked in the IDE when i connect my real bangle to it, and paste this code on the RHS and press "RAM".

    I am going to follow the guideline and make it into an app, is that okay? any suggestions? thanks

    wanna name it softreboot for short and SoftReBoot for the plain text name

    following this tutorial:
    https://www.espruino.com/Bangle.js+FirstĀ­+App

About

Avatar for ccchan @ccchan started