Erease code from Arduino

I'm currently using an Arduino Pro Micro. I uploaded a code using the Keyboard library, that wrote a 'Q' in an infinite loop. The next time I tried to upload something, i got the following error:

Global variables use 149 bytes (5%) of...
Error occurred while uploading the sketch

I guess the programming port is full of 'Q's, and there is no space left for me to upload the program.

Is there any way to completely erease an uploaded skethc? The only solutions I got are to upload an empty sketch, but as you may supose, I can't.

Hope you can help. Thanks!!

I doubt that that is the case. It is not how programming works. It is more likely that you have a communication problem.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Hi! Thanks for your answer.

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "D:\Arxius de Programa DISC D\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : usb
Using Programmer : stk500v2
An error occurred while uploading the sketch
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2104)
avrdude done. Thank you.

I've got the verbosity option always activated, hope it helps.
Thank you!

If you've made it into a USB device, you may have to go a bit out of your way to reprogram it.

I googled

 can't reprogram usb pro micro

and found

which may be your issue.

If it's not a help, google along the same lines, I just post the first one that looked plausible.

a7

One easy thing that also MAY work is merely closing the serial monitor window before trying the upload. At least here, when I have a program that is actively sending data out, and the serial monitor window is listening, the programmer seems to not always be able to get ahold of the port, since it is in use by the serial monitor.

That really worked! Thank you so much for your time :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.