A lot of cleaning, refactoring, bulletproofing is required, but the conceptual basis are there and it seems to work so I have hope, see head of sketch.js at https://editor.p5js.org/jgrizou/sketches/Si31amD_p.
That was fun anyway! I will try to handle the set route in the proxy too.
In time, I will make it a standalone and actually usable library but for now I am exploring.
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.
Ok that approach work. It is a tricky code with a few promise and using https://github.com/kozhevnikov/proxymise on top.
Code is very rough right now, just working my way around things. But, if curious, for now code is here: https://editor.p5js.org/jgrizou/sketches/Si31amD_p (see robot.js and sketch.js) and testable at https://editor.p5js.org/jgrizou/present/Si31amD_p
For example, if you have a espruino device with a code like:
You can load this page https://editor.p5js.org/jgrizou/present/Si31amD_p, click connect button and connect to the device.
Then in the webbrowser console the following commands should work:
A lot of cleaning, refactoring, bulletproofing is required, but the conceptual basis are there and it seems to work so I have hope, see head of sketch.js at https://editor.p5js.org/jgrizou/sketches/Si31amD_p.
That was fun anyway! I will try to handle the
set
route in the proxy too.In time, I will make it a standalone and actually usable library but for now I am exploring.