You are on page 1of 9

Arduino Software

handson.dmt.fh-joanneum.at

ARDUINO
Worksheet: Description: Difficulty (1-10): Overview: Arduino Software In this worksheet well setup the Arduino Software (IDE) and upload our first sketch to the Arduino Uno. 1 Getting Started User Interface Basics Initial Setup Opening the Blink sketch Uploading the Blink sketch Serial Monitor Basics Troubleshooting Useful Resources Hardware: Arduino Board (Uno) Connection Cable Software: Arduino Software (IDE)

Requirements:

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

DIGITAL IOS
To enable the Arduino boards to do a variety of cool things, we need to be able to communicate with it. To do this, we'll need a development environment also known as an IDE to write code and upload it to the Arduino board. Fortunately, Arduino comes with its own development environment thats freely available and easy to use. In this worksheet well guide you through the process of downloading and installing the Arduino Software and then uploading your first programme onto your Arduino Uno board.

Instructions
1. Getting Started Search in Google for Arduino Software. Click on the Arduino-Software link. The latest release at time of writing is Arduino 1.0.5. Choose your operating system. Download and install. In this example the mac OS X version will be used. The package is about 80mb(zip) and 200mb(unzipped) and will take less than a minute to download. Go to your download location and simply copy the package into your application folder to install As usual when running applications downloaded from the web for the first time, youll receive the following confirmation window:

Click Open to open the Arduino IDE

2. User Interface Basics


Carelse, Pauger, Pilz 2

Arduino Software

handson.dmt.fh-joanneum.at

In this section well familiarize ourselves with the Arduino IDE interface.

Upload Compiles your code and uploads it to the Arduino board. . Verify Checks your code for errors.

New Creates a new sketch.

Save Saves your sketch.

Open Existing Displays a menu list of existing sketches as well as pre-installed Arduino sketches to help you get started. Sketch Area Area for writing your scripts.

Serial Monitor Opens the Serial Monitor. The serial monitor can be used to view the data being transfered between your computer and Arduino. Useful for testing sensors and essential for debugging!

New Tab Allows you to manage sketches with more than one file.

Text Console Displays status and error messages.

Now, that weve got an overview of the Arduinos user interface. Lets get ready to load our first sketch onto our Arduino Uno.

3. Initial Setup
Carelse, Pauger, Pilz 3

Arduino Software

handson.dmt.fh-joanneum.at

To setup the communication port from the Arduino IDE to the Arduino board, we have to choose the board from the menu list. In our case its an Arduino UNO. Click on Tools Then Boards -> Arduino Uno

4. Opening the Blink Sketch Once youve selected the right Arduino board. Were ready to upload our first sketch. What hello world is to the programming world, Blink is to the microcontroller world. The Blink sketch will provide us with a basic overview to introduce us to the structure of an Arduino sketch.

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

Here we see a screenshot of what you can expect to see when opening the sketch.

When a line starts with two slashes // it indicates a comment and will not be compiled by the compiler. Useful for inserting helpful comments describing your code and what it does. The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each powerup or reset of the Arduino board.

The loop() function loops consecutively, allowing your program to change and respond as it runs. Code in the loop() section of your sketch is used to actively control the Arduino board.

5. Uploading the Sketch Once youve opened the Blink sketch and gained an understanding of the sketch structure, you ready to upload it to the Arduino board. If you havent connected your Arduino board yet, now is a good time to do so.

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

Once connected, select the serial device by going to Tools > Serial Port and selecting /dev/tty.usbmodem

Next, simply click on the upload button.

If the upload was successful youll receive a confirmation in the console area that uploading is done!

If all went well, you should then see an orange LED blinking close to pin 13.

Congratulations! You managed to upload your first sketch using the Arduino IDE!

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

Serial Monitor Basics


Understanding how to use the Serial Monitor is essential for creating interactive projects using Arduino. The serial monitor will enable you to send and receive data between your computer and Arduino. Ideal for receiving data from sensors and controlling motors attached to your Arduino using your computer. In the following example well learn how to send and receive data using the serial monitor. You could simply load the Simple Serial ECHO script (found in the download package) or code the snippet below into the Arduino IDE.

Once the sketch is loaded or coded, 1) verify and 2)upload the sketch to the Arduino. 2 1

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

After uploading the sketch successfully click on the Serial Monitor button to launch the serial monitor window.

A window similar to the one below should open up. Type in some text of your choice and click send. The serial monitor then sends the data to the Arduino with the Arduino echoing it back to the serial monitor.

If you would like to continue the example above, please click on the following link where you will learn how to integrate the Arduino IDE and the Processing IDE: http://arduinobasics.blogspot.com.au/2012/07/arduino-basics-simple-arduino-serial.html

Trouble Shooting
Incase the Arduino Software loads in another language, go to the preferences menu and choose your language of choice from the drop down menu.

Carelse, Pauger, Pilz

Arduino Software

handson.dmt.fh-joanneum.at

You sketchbook folder can also be changed to a more preferred location

Useful Resources
Ladyada Using the Serial Library http://www.ladyada.net/learn/arduino/lesson4.html Arduino Basics Simple Arduino Serial Basics http://arduinobasics.blogspot.co.at/search/label/Serial%20Monitor Arduino Development Tools http://playground.arduino.cc/Main/DevelopmentTools Arduino Basics Blog Simple Arduino Serial Communication http://arduinobasics.blogspot.com.au/2012/07/arduino-basics-simple-arduinoserial.html Processing Language (IDE) http://processing.org

Carelse, Pauger, Pilz

You might also like