I just was playing around. Now that the board seems to work, I'd like build some touch UI on top of it and that were my first steps last night, when I realized that calling the connect function again would result in adding watches, not deleting the former. Just wanted to get rid of the older ones and see where I would put the switching of "active" screen areas.
You're probably right about the re-init, so I'll try to put the picking behind that one callback.
I still seem to have to re-polish my JS skills. Right now I always end up with code copied into handlers when I just want to pass a reference to a function and I still have no idea on how to access/create "top-level"/global vars from within a handler. Is there a name/reference for the Espruino top level object (the one I get with "this" when in the shell)? Or maybe that's just the wrong pattern to communicate between handlers and set up a system.
BTW: Also I see a growing number of "LCD = {}" entries when I look into the var with dump(). I can do multiple "delete LCD" to get rid of them, but neither do I know where the come from, nor how multiples of them can exist be created in the first place.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I just was playing around. Now that the board seems to work, I'd like build some touch UI on top of it and that were my first steps last night, when I realized that calling the connect function again would result in adding watches, not deleting the former. Just wanted to get rid of the older ones and see where I would put the switching of "active" screen areas.
You're probably right about the re-init, so I'll try to put the picking behind that one callback.
I still seem to have to re-polish my JS skills. Right now I always end up with code copied into handlers when I just want to pass a reference to a function and I still have no idea on how to access/create "top-level"/global vars from within a handler. Is there a name/reference for the Espruino top level object (the one I get with "this" when in the shell)? Or maybe that's just the wrong pattern to communicate between handlers and set up a system.
BTW: Also I see a growing number of "LCD = {}" entries when I look into the var with dump(). I can do multiple "delete LCD" to get rid of them, but neither do I know where the come from, nor how multiples of them can exist be created in the first place.
So. Arrived at the JS level, at last :)