Avatar for user53899

user53899

Member since Mar 2015 • Last active Mar 2015
  • 0 conversations
  • 1 comments

Most recent activity

  • in Interfacing
    Avatar for user53899

    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);
    });
    
Actions