Saturday, November 27, 2010

Just bought an Arduino, What's next?


This article briefly explain what is to be done just after purchasing an Arduino board. Even though the prerequisites of Arduino is less compared to other development boards, I think this article will be useful because Arduino is being popular among beginners. This article deals with the latest version of Arduino at the time of writing - it is Arduino UNO.
Setting up drivers
Connect Arduino to your computer via USB cable. It will power up from USB power. Now start Arduino IDE. If you have not Arduino IDE download from here. No need to install the software. Just extract using your favourite decompressing utility (my favourite is 7zip) and run the executable named 'Arduino'. Now you have to set up your IDE to work with your Arduino UNO. First select your hardware from Tools -> Board -> Arduino UNO (or your exact hardware name. If it is not listed, try to download the latest version). Next, select your serial port from Tools -> Serial Port. Selecting serial port is in different way different OS.
Linux
If the 'Serial Port' menu is not active, probably, your device is not connected properly. Try to reconnect. If more than one serial ports are shown in the menu, we need to find out which is the correct one. To do that, disconnect your arduino first. Then you probably need to restart the IDE. Then look at the 'Serial Port' menu and note down the listed COM ports. Then reconnect your device and track the newcomer. This is the easy way. Select it.
One of the problem I suffered while playing with arduino in my Ubuntu 10.04 LTS was that, the compilation of the program was a failure. It was a dependancy problem. So what I did is that, installed Arduino IDE as described here. But it was an older version and my device UNO is not listed in it. Then downloaded the newer version from the downloads page. That was really a tricky step!
MS Windows
In Windows, just after connecting your device to the PC, a device driver wizard appears and try to find the appropriate device driver for the device. It will take a while and at the end of the fight, it fails to find an appropriate driver. Close the wizard and go to 'Device Manger' (Either via Control Panel or by right clicking 'My Computer' then 'Manage'). Then you can find Aduino UNO as the unknown device. Right click on that and choose the option to manually install the driver. Then locate the directory where you have installed Arduino IDE. Then the system install the appropriate driver and now you can see your device on the list named 'Ports' in the Device Manger. In parenthesis, there will be the curresponding COM port number (eg: COM 4) . Then choose that COM port in the Arduino IDE.
Starting with 'Hello World'
The commonly accepted 'Hello World' in embedded devices is LED blinking. There is an example in the IDE itself. Open the file from File -> Examples -> Basics -> Blink
Look at the program. For an average C programmer, the program seems self-explanatory. To compile your program, choose Sketch -> verify/compile. Then to upload the executable to your device, choose,File -> upload to I/O board. If everything you have done is correct, you will get your Arduino programmed and starts working just after burning the program using the USB power. Disconnect it from USB and use in your standalone applications.
Read more..
Arduino Lanugage reference
Arduino Playground

No comments: