i have done research to solving this but i have found no working solutionthe arduino UNO and wire does work since it does occasionally work when i reinstall the driver for the arduinoall the setting should be working as well

There are a few primary causes to this error: Wrong COM port selected (Tools ---> Serial Port), The drivers are not installed properly, or The wrong board is selected (Tools ---> Board ---> Arduino Uno).

What OS are you running?

If the the IDE works occasionally I would expect it to be a driver issue, try this video:

If you don't see an Arduino device listed under Ports; then you are probably seeing an "Unknown Device". Check to make sure that "Unknown Device" is indeed, the Arduino by plugging and unplugging the board from the computer. "Unknown Device" should appear and reappear. Assuming this is the case, you will need to install the drivers manually for your Arduino. Windows XP, Vista and 7 users may continue with the guide; if you are a Windows8 user, then please make reference to the youtube link above.

Select to "Update Driver..." and then choose to select the folder containing the driver on your computer. Conveniently, you already have the drivers for the Arduino on your computer when you installed the Arduino IDE. Navigate to within the Arduino files (where your .exe is; it'll probably be in your Downloads if you didn't move it. In the third picture, you can see my pathway to the drivers folder) to the "drivers" folder and choose the folder. The computer should automatically choose to install one of the drivers within the folder you selected. Simply proceed with the installation and that should fix the problem.

(Disclaimer: Not My instructions)

Logged

There are 10 types of people in the world: those who understand binary, and those who don't.

before it was COM 3 but i changed it to COM 7, i dont know why it made a difference seeing how COM 3 wasnt used for anything just like COM 7 but i got it to work and can now download programs to the arduino