Note that the examples are for the newer Chrome M33, not the version of Chrome that you may have by default on your chromebook (not sure).
On an Arduino their example requires you to compile a special program on the Arduino, and they just send the characters "y" and "n" to it. On Espruino, you should be able to just modify their code (at the bottom of main.js) to send "LED1.set()\n" and "LED1.reset()\n" instead.
From the other examples hopefully you can work out how to get character data back. In the Web IDE, we tend to just 'wrap' the data in something that's easy to pick out on the PC - for instance:
console.log("<<"+"<<"+mydata+">>"+">>")
And then when it executes it outputs <<<<mydata>>>> which is pretty easy to detect and extract with a simple bit of code.
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.
Best bet is probably to look at some of Chrome's own examples... They have one on turning a LED on and off on an Arduino:
https://github.com/GoogleChrome/chrome-app-samples/tree/master/serial/ledtoggle
and reference on the serial API here:
http://developer.chrome.com/apps/serial.html
Note that the examples are for the newer Chrome M33, not the version of Chrome that you may have by default on your chromebook (not sure).
On an Arduino their example requires you to compile a special program on the Arduino, and they just send the characters "y" and "n" to it. On Espruino, you should be able to just modify their code (at the bottom of
main.js
) to send "LED1.set()\n" and "LED1.reset()\n" instead.From the other examples hopefully you can work out how to get character data back. In the Web IDE, we tend to just 'wrap' the data in something that's easy to pick out on the PC - for instance:
And then when it executes it outputs
<<<<mydata>>>>
which is pretty easy to detect and extract with a simple bit of code.