Arduino Leonardo: Oops. Infinite HID loop.

I’m probably not the first one. But I feel so dumb.

I deleted a while statement and didnt realize it. So now my Leonardo is typing things constantly.

What do I do if I bricked my Leonardo? Is there an easy way to stop it from outputting HID stuff?



Reload the bootloader via the ICSP header. Then redownload your sketch.

You can try loading a simple sketch (eg. Blink), just use the manual reset button on the Leonardo about a second after clicking the upload button in the IDE. If it’s timed right, the bootloader and the IDE will see each other while the IDE is attempting to send the sketch. If it doesn’t work on the first attempt, try a couple more times. I’ve been in the same position and was able to rescue my Arduino this way.

Of course, reloading the bootloader is always an option too if you have a programmer or another Arduino to use.


I don't think Leonardo works the same way due to the built in USB. I don't recall where I read that tho.

Steph! You rock!

I can’t believe that worked! I was worried that it wouldn’t, because the IDE doesn’t appear to recognize there is a usb port until it starts spitting out HID commands. But it totally worked. First try.

Thanks so much

Arduino: Saved.