Ahh, I think you might have hit the 'console on Serial1' issue. Basically when you disconnect from USB the console moves onto Serial1 (which is pins B6 and B7) by default - and you're using B7.
So you have two options:
Add USB.setConsole(1) right at the top of onInit, which should force the console onto USB forever, so it never messes with your pins.
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.
Ahh, I think you might have hit the 'console on Serial1' issue. Basically when you disconnect from USB the console moves onto Serial1 (which is pins B6 and B7) by default - and you're using B7.
So you have two options:
USB.setConsole(1)
right at the top ofonInit
, which should force the console onto USB forever, so it never messes with your pins.B7
to some other pinI reckon that should sort it out.