Professional Documents
Culture Documents
Lab Background
1. Basic Computer Skills. Student should be comfortable starting applications, opening,
closing and saving files, cutting and pasting text, and locating files/folders.
2. Basic Programming Skills. Student should be familiar with creating simple programs
in C/C++ as well as working in a programming development environment.
3. Overview of the Arduino. Student should have a basic knowledge of the components
and capabilities of the Arduino board (Uno—R3).
Laboratory Pre-Exercise
1. Review the tutorial video:
http://www.youtube.com/watch?v=s3TxkUo1jNg
2. Review the basic programming structure for ANSI C and Arduino programs
3. Familiarize yourself with the EduShield Schematic
The Programming Structure of the ANSI C
In any kind of C programming, a program is comprised primarily of
subroutines. The ANSI C program structure is shown below.
We set that both the setup and loop routines are required. Both of these
are functions that return nothing.
The Basic Blink Program
A most basic Arduino program is given as an example. It is the Blink
program shown.
We note that comments can used either by using // that comments the rest of
that line, or using /* ... */ for a multi-line comment.
EE 260 Lab 1 Introduction to the Arduino page 2 of 4
This program introduces three new commands that are specific to the Arduino.
pinMode(pin,mode). This configures a pin to be either an input or
ouput. The value of pin can be 0-13, and mode can be either INPUT or
OUTPUT.
Students are encouraged to read the online documentation about these commands
for further information.
Laboratory Project
The objective of this lab is to get a simple exposure to the Arduino by exploring its
basic capabilities and its programming structure. This will be done by creating a
Night-Light function using the Arduino and the EduShield.
1. Move the (red) jumper on the EduShield so that the RGB LED is used.
4. Create code that causes each of the LEDs in sequence to light for 1/3 of a second and
pause for 1/2 second, then repeat once all four have lit.
Laboratory Report
Your report should explain what you have done, and how you have gone about doing it for
each part. Indicate anything special that you did.
Your report should include the following:
For each program document the intended purpose of the program and its approach at the
beginning of the program.
For each program, provide a comment for each line of code.
Explain in detail anything that might not be obvious to the reader so that they can
understand what you are doing.