Error message during download

Hi!

I just get an error message at the end of dowloading. Trying old and working sketches gives the same error message.

The message is:

avrdude: ser_open(): can't set com-state for "\.\COM4"

The program is:

void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);

}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
delay(500);

digitalWrite(13, LOW);
delay(500);

}

What can be wrong?

Regards,
Railroader

What can be wrong?

Lots of things. Start by putting the Arduino in a drawer. Lock the drawer. Mail the key to a friend in another country.

Open the IDE. Make a list of the ports available in the Ports menu item. These are the ports that the Arduino is NOT connected to.

Write you friend, and ask him/her to send the key back. When it arrives, open the drawer. Get the Arduino out. Connect it to the PC. Open the IDE. Make a list of the ports available in the Ports menu item.

Compare the two lists. The port(s) that are on the second list that are not on the first list are the ports that the Arduino MIGHT be connected to. Select one of them, and try uploading again. If that fails, select the next one, until the upload does succeed.

Thanks for Your time writing!
The problem is solved using other steps.