There are many factors involved in uploading a program to your Arduino board, and if any of them are missing, the upload could fail.
You can check the following suggestions to help you solve any potential problem:
1. Make sure that you chose the right board and port, and have installed all the drivers needed.
2. If you are still running into an error, you can copy the error message and search it through our troubleshooting guide page.
Below you will find further guidance on the steps mentioned.
The online Arduino Web Editor detects your board and port automatically, but if you are using the offline Arduino Software IDE, you need to select both your board and port manually using the following tips:
Make sure you have the right item selected in the Tools > Board menu. If you have an Arduino UNO, you'll need to choose it.
Then, check that the proper port is selected in the Tools > Serial Port menu (if your port doesn't appear, try restarting the IDE with the board connected to the computer):
Drivers provide a way for the software on your computer (i.e. the Arduino software) to talk to any hardware you connect to it (i.e. the Arduino board).
The easiest way to check if the drivers for your board are installed correctly is by opening the Tools > Serial Port menu in the Arduino software with the Arduino board connected to your computer.
Additional menu items should appear relative to when you open the menu without the Arduino connected to your computer. Note that it shouldn't matter what name the Arduino board's serial port gets assigned as long as that's the one you pick from the menu.
On Windows 7 (particularly the 64-bit version), you might need to go into the Device Manager and update the drivers for the UNO or Mega 2560. Just right click on the device (the board should be connected to your computer), and point Windows at the appropriate .inf file again. The .inf is in the drivers/ directory of the Arduino software (not in the FTDI USB Drivers sub-directory of it).
If you get this error when installing the UNO or Mega 2560 drivers on Windows XP: "The system cannot find the file specified", you might try this suggestion (about adding a "RunOnce" key to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion").
On Linux, the UNO and Mega 2560 show up as devices of the form /dev/ttyACM0. These are not supported by the standard version of the RXTX library that the Arduino software uses for serial communication. The Arduino software download for Linux includes a version of the RXTX library patched to also search for these /dev/ttyACM* devices. There's also an Ubuntu package (for 11.04) which includes support for these devices. If, however, you're using the RXTX package from your distribution, you may need to symlink from /dev/ttyACM0 to /dev/ttyUSB0 (for example) so that the serial port appears in the Arduino software.
1sudo usermod -a -G tty yourUserName2sudo usermod -a -G dialout yourUserName
Log off and log on again for the changes to take effect.
In the Arduino Help Center you will find articles on frequently asked questions, and troubleshooting guides for most of the errors you might encounter. You can use our help center by browsing through the different categories and the questions provided in each of them, or by searching your error in the search tab.
If it still doesn't work, you can ask for help in the forum. Please include the following information: