You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Looks like in the new code you changed to checking status==1 so you also need to set status=0 in device.on('gattserverdisconnected', function() {

    You could try sending uart.write("\x03\x10digitalWrite(LED1, 0),digitalWrite(D29, 0);\n");} to the MDBT42

    Newer firmwares (2v15 I think?) will auto-clear the input line when Bluetooth disconnects/connects so it's not needed, but on earlier versions, if a send half-completed and you were left with digitalWr on the input line (for instance) you'd then end up with Espruino trying to execute:

    digitalWrdigitalWrite(LED1, 0),digitalWrite(D29, 0);
    

    Which would fail and not light any lights...

About

Avatar for Gordon @Gordon started