Project Home |
As mentioned before, Project Illuminate is using the Arduino Uno to control 25 color-changing LED lights. We're going to start learning the basics so that we can create the project---your group should do this together, so please make sure everyone has finished the tutorial before doing this part!
Let's begin by understanding the Arduino board and its programming environment.
Your board, an Arduino Uno, should look like this:
First, use the provided USB cable to connect the board to the computer in the
lab. The computer both communicates with the Arduino and provides power to the
Arduino through this cable. The large end connects to any of the USB slots on
the front of the computer, and the small end connects to the board here:
When it is connected correctly, a green LED should turn on.
The Arduino board comes with its own programming environment. The Arduino programming environment is an IDE, or Integrated Development Environment, which is a program that is designed to aid in the development of other programs. An IDE will usually include a means of entering (typing in) and modifying programs, called an editor, and a means of translating the program to computer format called a compiler.
Now, let's open the programming environment. First, log in to the computer
using the username and password of one of your group members. Once logged in,
open a terminal (using the icon at the bottom of the screen, just as you did for
the C++ tutorial) and type arduino &. (The & tells the
computer to allow you to continue to use that terminal while the IDE is
running.)
A window should open that looks similar to this one:
This window is a sketchbook, and the sketchbook is where your Arduino
programming will begin.
Before you can use your board, you'll need to tell the computer where it is connected. Do this by going to drop down menu at the top of the window and selecting the Arduino Uno listed on the /dev/ttyACM0 port.
Now we'll practice using the board by executing one of the provided examples. From the File menu, select Examples->01.Basics->Blink. This will open a new sketchbook, Blink.
The Blink sketchbook consists of a single file, so there is only one tab at the top (labeled Blink). You'll notice that the file has two functions: setup() and loop(). These functions exist in every Arduino program. Arduino will execute setup() to initialize the device and then it will continuously execute the code in loop() until it is disconnected.
To run Blink, click on the right arrow in the tool bar. This arrow
tells the environment to compile the program and upload it to the
Arduino board.
After the file has successfully compiled and is being uploaded, the
transmit and receive LEDs on your board should blink. These LEDs
indicate that the board is receiving and transmitting data. They are
located here:
Once the program is uploaded, this LED should begin to blink orange:
Congratulations! You have successfully begun using the Arduino board.
Turn your cups to red so that a member of the camp staff can check your setup,
and switch drivers!
Next, we'll learn to connect the
lights.