An error occurred while uploading the sketch

so I'm working on a simple motor program. and it will compile but not load. All it says is, "An error occurred while uploading the sketch"

void setup()
{
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}

void loop()
{
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
analogWrite(9,100);
delay(1000);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
analogWrite(9,50);
delay(3000);

}

not very long...see. Can someone hepl

If you got a good compile message then the problem isn't the code. There is some issue with the computer trying to talk to the board to upload it. Are you sure you have the right com port selected in the tools menu?

I checked the com port...that not it. Thank you, at least I know its not a ; in the wrong place.

It usually says more :wink: You can scroll through the output window (at the bottom of the IDE). When you have errors, select all orange text from the output window and copy/paste it here (using code tags).

Thank you, at least I know its not a ; in the wrong place.

You can easily check that by just compiling (verify) instead of uploading :wink: