You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'm surprised you can't get at global vars within a handler normally - stuff like setWatch/setInterval will set this to be the global object, but just accessing a variable within a function will access the global version if a local one doesn't exist.

    As far as callbacks, if you do:

    function touch(x,y) {
      ...
    }
    require("Touchscreen").connect(touch);
    

    Then you can redefine the touch function, either by just entering it again, or by typing edit("touch").

    Shame about the LCD={} stuff. It's a bug in the LCD implementation (normal Espruino doesn't come with the LCD object, so I didn't spot it). I believe I just fixed it, so the next compile from Git should sort it out.

About

Avatar for Gordon @Gordon started