Arduino is an affordable and easy to work with development board based on the Atmel Atmega8
microprocessor. This page contains introductory notes on how to get started working with
Arduino.Arduino home page
The information given here assumes that you have an Arduino board with USB.
1 Installation
1.1 Windows
Quite painless. The Howto at the Arduino site has more detailed installation instructions than the ones given here.- Download the IDE (Integrated Development Environment) from the Arduino site and unzip. Also unzip the 'FTDI USB Drivers' in the 'Drivers' folder.
- Connect the Arduino board and hardware wizard will start up. Point it to look for drivers in 'FTDI USB Drivers'. Open 'Control panel \ System \ Hardware' and check which COM-port the board has become.
- Open up the Arduino IDE and pick the correct COM-port under the 'Tools' menu.
- Testing - Copy BlinkingLED from the Arduino site. Press 'Verify' (the play button) to compile and 'Upload' to transfer the program to the Arduino. You may have to press the reset button on the Arduino board shortly before transferring the program.
1.2 Linux
Not painless :-(To run the Arduino IDE (Integrated Development Environment) you first need to install the AVR tool chain and, if you don't already have it, Java. The largest problem is getting avr-c++ (which is required by the Arduino IDE) installed. It's possible to get most of the AVR tool chain installed by following the avr installation instructions for atmega128.
2010-03-25: Installing avr-g++ is now quite painless. Just do
yum install avr-gcc-c++to install avr-g++. Provided that you already have java installed the ardunio installation is now just a matter of unpacking the arduino tarball.
1.3 Mac
I have not tried running the Arduino IDE (Integrated Development Environment) under Mac. Read the Howto at the Arduino site for Mac installation instructions.2 Arduino and AVR
Note: The method for restoring the bootloader described in this section will not work if you have an Arduino board with an Atmega168 chip. The instructions here are only valid for Arduino boards with Atmega8 chips.It is possible to use AVR to program Arduino instead of using the IDE. If you choose to do that you will need a programmer cable connected to your parallel port and the 2 by 3 ICSP (In-Circuit Serial Programming) pins on the Arduino board. Typically the programmer cable is a ribbon cable, and in that case the red edge should line up with pin 1 on the ICSP connector. If you use this method you will wipe out the Arduino bootloader, but don't worry - it's quite easy to restore. There are instructions on how to restore the Arduino bootloader at the Arduino site. There's a burn bootloader menu item under the tools menu that you can use. Unfortunately that method did not work on my machine. If you also have trouble reloading the Arduino bootloader try the following instead:
uisp -dprog=stk200 -dlpt=/dev/parport0 --erase uisp -dprog=stk200 -dlpt=/dev/parport0 --upload if=ATmegaBOOT.hex -v=3 --hash=32In order for this to work you need uisp installed and uisp needs to be in your path. You also need the ATmegaBOOT.hex which can be found in the drivers folder of your Arduino installation.
3 Serial communication from Arduino to computer
Serial communication back to the computer is really helpful for example when debugging programs. Here's a little test program that sends "Hello world!" at a rate of once per second back to the computer.
void setup()
{
//sets the baud rate and initializes serial communication
Serial.begin(9600);
}
void loop()
{
//send message
Serial.println("Hello world!");
//wait for one second
delay(1000);
}
3.1 Linux
You can use minicom to receive messages. Run minicom (you probably need to be root) and press Ctrl+A Z to display the available commands. Press 'o' for Options and choose 'Serial port setup' and make sure you've got the correct port selected (most likely /dev/ttyUSB0). Also make sure that the baud rate is set to 9600 8N1 and that 'Hardware flow control' is set to 'no'. Once you are done with the settings use 'Save setup as dfl' and minicom will start up with the correct settings next time. Quit minicom and restart it to activate the new settings. You should now start receiving the 'Hello World!' messages.3.2 Windows
In Windows XP and older you use hyperterminal (It was apparently dropped from windows in Vista, and as far as I know it is not available in Windows 7 either). If you have hyperterminal it is located in \ Program \ Accessories \ Communication. Run the program and pick a name for the connection. Pick the correct COM-port in 'Connect with'. Set bits per second to 9600, databits to 8, parity to none, stopbits to 1, and flow control to none. When you press connect you should start receiving the "Hello world!" messages.3.3 Arduino
It turns out that the Arduino IDE also can show you serial messages. Press
and messages sent from
Arduino should appear at the bottom of the IDE.
The hyperterminal (windows) and minicom (linux) setup instructions are still useful. You can use both programs to receive and send serial messages. As far as I can tell the IDE only has built in functionality for receiving messages sent from Arduino.