You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi, what you're doing is fine, however you may not have to set your global variables on onInit()...

    • If you declare a global variable, it will be saved (along with its value) just like a function or object definition would be - so declaring them is absolutely fine.
    • Also, any setInterval or setWatch that was created will be remembered
    • onInit() will just be called once by the system at startup, after a hard reset or a call to load or save.
    • reset will reset the device but won't load the saved code (so won't execute onInit).

    If you just send your code over to the device then you'll have to call onInit. However if you send your code to the device and then type save(), onInit will be called automatically

About

Avatar for Gordon @Gordon started