I am new to Espruino and have just had a lot of difficulty with this. For that reason I am posting my solution for future reference. Sorry to raise the dead.
The following code allows me to toggle LED1 via echo 'a' > /dev/tty.usbmodem1411. I am not sure if the tty would be different for another user(?)
var state = false;
LED1.write(state);
Serial1.setup(9600);
Serial1.setConsole();
Serial1.on('data', function (data) {
state = !state;
LED1.write(state);
});
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 am new to Espruino and have just had a lot of difficulty with this. For that reason I am posting my solution for future reference. Sorry to raise the dead.
The following code allows me to toggle LED1 via
echo 'a' > /dev/tty.usbmodem1411
. I am not sure if the tty would be different for another user(?)