• All you need to do is...

    • Copy _examplePlugin.js to a new JS file in the plugins folder
    • Replace the contents of the init function with something like:

      Espruino.Core.App.addIcon({ 
          id: "sendTime",
          icon: "star", 
          title : "Send the current Time", 
          order: 300, 
          area: { 
            name: "code", 
            position: "bottom"
          },
          click: sendTime
        });    
      

    Then add a sendTime function that calls:

    Espruino.Core.Serial.write(`\x03\x10setTime(....)\n`, false, function() {
                    Espruino.Core.Notifications.success(`Sent the time`, true);
                  });
    

    And I think you'll be done. It might be a nice thing to have as an option, so you could copy the code from https://github.com/espruino/EspruinoWebIDE/blob/master/js/plugins/codeLink.js which puts an option in Settings which shows/hides the icon when toggled

About

Avatar for Gordon @Gordon started