Modify USB profile to remove serial port - With switch (Leonardo)

Hello,

I found a way here to disable the Serial port that appears in the Device manager for a simple HID exemple

But I would like to had a switch on the leonardo that disables serial port when off and enables it when on.

If someone know how to edit the code to do it.

Thanks

1 Like

But I would like to had a switch on the leonardo that disables serial port when off and enables it when on.

This is the case with my Leonardo. It doesn't show a device when the Leonardo is off and it shows one if the Leonardo is on.

I guess you meant something different but you must describe it in more detail so I also get a clue of what you're trying to achieve.

Thanks for your reply, I mean adding a switch to one of the pins of the leonardo, like for exemple pin 6, if pin 6 is grounded then disable serial port.
This switch would be use if we need to reprogram the leonardo.

Thanks

Press the reset button to put the Leonardo in upload mode for 8 seconds.