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, powered by microcosm.
Report a problem