there is no need to initialize USB , just attach device to computer and it should be automatically enabled. And the idea I mentioned was to actually switch console away from USB so better something like Serial1.setConsole() or LoopbackA.setConsole()
Of course after running this you cannot connect over USB via Espruino IDE, this is for final state when the project runs as designed. However you can make this conditional on something (button or some other pin high/low). Also I think when you hold button while inserting pico to USB it may avoid starting your code at all so that can be the way to connect IDE and change stuff
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.
there is no need to initialize
USB
, just attach device to computer and it should be automatically enabled. And the idea I mentioned was to actually switch console away fromUSB
so better something likeSerial1.setConsole()
orLoopbackA.setConsole()
Of course after running this you cannot connect over USB via Espruino IDE, this is for final state when the project runs as designed. However you can make this conditional on something (button or some other pin high/low). Also I think when you hold button while inserting pico to USB it may avoid starting your code at all so that can be the way to connect IDE and change stuff