With the IDE, that's great! Thanks for the pointers, I'll have a dig and try and raise a PR. upload seems fine for my use case, I could just print "Hello from MicroChat" or something.
TIL about the emulator - that's amazing! wow.
With the prompt & buttons. I've been playing with a (sketchy atm) host/puck rpc wrapper. It's pretty similar to Puck.eval(…), but it lets you do async listeners and handles errors.
It lets you write browser code like:
await rpc('new Promise(resolve => setWatch(() => resolve(), BTN))')
console.log('Battery level: ' + await rpc('E.getBattery()'))
try {
await rpc('E.getButtery()')
} catch(e) {
// Error - getButtery is not defined
}
I'm still playing around, but I'm hoping that it'll make it easier to spread code between a page & microcontroller. So for chat button prompt for "light-on: yes/no" could be in react/telegram/wherever.
The other option I explored was puck = new PuckWorker('puck-script.js'), which would feel like a web-worker, but be running on a puck. You get a nice pattern for messaging, and puck-script.js would be espruino-only code, which might make it easier for more complex usage. Though I guess it's a bit of a different usage to having longer-lived scripts running.
Aw, his own rover sounds so much fun! (Perseverance is amazing 🤩).
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.
With the IDE, that's great! Thanks for the pointers, I'll have a dig and try and raise a PR.
upload
seems fine for my use case, I could just print "Hello from MicroChat" or something.TIL about the emulator - that's amazing! wow.
With the prompt & buttons. I've been playing with a (sketchy atm) host/puck rpc wrapper. It's pretty similar to
Puck.eval(…)
, but it lets you do async listeners and handles errors.It lets you write browser code like:
I'm still playing around, but I'm hoping that it'll make it easier to spread code between a page & microcontroller. So for chat button prompt for "light-on: yes/no" could be in react/telegram/wherever.
The other option I explored was
puck = new PuckWorker('puck-script.js')
, which would feel like a web-worker, but be running on a puck. You get a nice pattern for messaging, andpuck-script.js
would be espruino-only code, which might make it easier for more complex usage. Though I guess it's a bit of a different usage to having longer-lived scripts running.Aw, his own rover sounds so much fun! (Perseverance is amazing 🤩).
Gonna check out your bookmarklet!