0% found this document useful (0 votes)
326 views18 pages

Laboratory Activity 1

The document provides instructions for installing and using the Arduino IDE software and setting up an Arduino board. It describes downloading and installing the Arduino IDE, which is used to write programs called sketches. The IDE compiles sketches and uploads them to the Arduino board via USB. Basic circuits are presented to demonstrate powering an LED from the board and programming the LED to blink on and off pin 13. Exercises have the user modify the code to change timing and connect multiple LEDs in patterns.

Uploaded by

joshua paliza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
326 views18 pages

Laboratory Activity 1

The document provides instructions for installing and using the Arduino IDE software and setting up an Arduino board. It describes downloading and installing the Arduino IDE, which is used to write programs called sketches. The IDE compiles sketches and uploads them to the Arduino board via USB. Basic circuits are presented to demonstrate powering an LED from the board and programming the LED to blink on and off pin 13. Exercises have the user modify the code to change timing and connect multiple LEDs in patterns.

Uploaded by

joshua paliza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Laboratory Activity 1

COE 5
Software Installation

1. Download the software and install by


following the step-by-step directions at:
http://arduino.cc/en/Main/Software
The Integrated Development Environment (IDE)

1. Software programs, called sketches are


created using the Arduino IDE.
2. The IDE enables one to create, open, change
sketches, convert these codes into
instructions for the Arduino Hardware to
understand.
3. The IDE also uploads/transfers the converted
codes into the Arduino Hardware (via USB
cable).
The Integrated Development Environment (IDE)
The Integrated Development Environment (IDE)

1. Compile – converts the program


codes/sketches into instructions that the
board understands.
2. Stop - stops the compilation process.
3. Create new Sketch - opens a new window to
create a new sketch.
4. Open Existing Sketch - loads a sketch from a
file
The Integrated Development Environment (IDE)
7. Save Sketch - saves the changes to the sketch
8. Upload to Board - compiles and transmits
sketches to board via USB cable
9. Tab Button – enables one to create multiple
files in your sketch.
10.Sketch Editor - write or edit sketches
11.Text Console – shows the IDE status (and
displays syntax errors)
12.Line Number – points the line number where
syntax error occurred after compiling.
Setting Up the Arduino Board

The Arduino Board (UNO)

Board Set-Up
To power up the board and verify if it is working, plug in the board
to a computer via USB cable and check if:
1. LED power indicator illuminates (green)
2. Pin 13 LED flashes ON and OFF
Exercise 1: Basic Circuit 1
 The purpose of basic circuit1 is to demo how to access power from the
board

1. With a wire, connect 5V power and ground from the Arduino to


the bread board (see figure above)
2. Apply the established 5V supply to an LED (use limiting resistor)
3. Plug power into the Arduino (via USB to computer/battery/PS)
4. The LED should light up. If it doesn’t, unplug power ,check
connections and try again
Exercise 2: Basic Circuit 2
 The purpose of the basic circuit2 is to demo how Arduino will be controlling
the LED

1. Modify Basic Circuit 1 by taking the wire from h3 and connect it


to pin 13 of the Arduino. (the default output pin of a new Arduino
board)
2. Write a program to control the LED. Each program must contain at
least two functions.
Exercise 2: Basic Circuit 2
1. List the codes below in the sketch editor
defines a constant that can be
used throughout the program

sets up the pin to be output

writing HIGH out on the pin


connected to the LED which will
turn the LED on

writing LOW out on the pin


delays in connected to the LED which will
milliseconds turn the LED off
Exercise 2: Basic Circuit 2

Notes on Program Codes

 Codes are case sensitive


 Spaces, tabs, blank lines are collapsed as a single space
 Blocks of code are encapsulated with curly braces ’{’ and ’}’
 Every open parenthesis ’(’ must be closed by ’)’
 No commas in numbers.
 Each executable program statement must end with a semicolon ’;’.
Exercise 2: Basic Circuit 2

Comments
Additional comments can be used to dissect the parts of the program
codes. These are ignored by the IDE during compilation but are useful
for the users.
Two forms of comments:
 block comment – enclosed by / * (comments here!) * /

 single line comment – starts with a //


Activity
1. Change the amount of time the LED is off to 1 second. (Leaving the
amount of time the LED is on at ½ second.)
2. Change the pin to which the LED is connected from pin 13 to pin 2
(Note that both the circuit AND the program must be changed.)
3. Hook up 8 LEDs to pins 2 through 9 (with limiting resistors)
Modify the code to turn on and off each one in order.(note: hook
them up one additional LED at a time
and make sure the new one works before you add the next one)
4. Modify no. 3 and use 12 LEDs instead, make them turn on
and off in a pattern similar to a Christmas light- be creative!

Include comments in your program codes to explain/dissect the overall


program. Have your work checked by your lab professor…..
Yours Program Codes Here!

(paste your program codes here)


Observations and Conclusions

(one/two pager only)


References

Arduino Cookbook
Recipes to Begin, Expand, and Enhance Your Projects
By Michael Margolis

Introduction to Arduino
by Alan G. Smith

Arduino On Line Courses


Windows Installations
Windows Installations

You might also like