Communication problem

Hello
I'm using a Arduino w/ ATMega 328. I'v been able to upload a program to the arduino before, but suddenly it failed the attempt and gave me this error:
avrdude: stk500_getsync(): not in sync: resp=0x00
I know that i've chosen the right board in the "tools" menu, but my serial port is always COM1, even though nothing is connected. When i change usb port
on my computer, it still is at COM1.
Tried to look up similar problems, but it seems they are kind of different.
Thank you for any feedback!

Photoresistor

It looks like no COM port was assigned, for some reason, to your Arduino.
I would reset the PC and try again.

Yes it does.
Will it help to switch the usb port, or does it not matter which one i use and other usb devices connected to my computer?

It shouldn't matter. The USB device will (hopefully) make a "pseudo-serial" port appear in your device manager which you can choose to use.

I just JUST got over the same issue.

In Tools-> Board, make sure you've selected the right board.
You already said you checked the COM port, so no worries on that.
If you have any devices connected to the arduino, unplug them before you upload,
unplug EVERYTHING and close the IDE
plug everything back in and start the IDE back up

if that doesn't work,

try hitting the reset RIGHT before you hit upload (if you have a reset button)

and if that STILL doesn't work,

unplug your board from the USB connection, and hit upload (this might not make sense, but wait)
when the application does that "Binary sketch size blah blah" thing, plug it back in.

if that doesn't work, your problems are worse than mine were.

Good luck.

EDIT: Misinterpreted your COM issue. Try everything I suggested, but also try reinstalling the driver.

Thanks for the respons. I tried all you said, but it won't upload the sketch without the error message.

EDIT: Misinterpreted your COM issue. Try everything I suggested, but also try reinstalling the driver.

I downloaded the program one more time, but it didn't work. Not sure if that was what you suggested.