CSc 4110/6110 Embedded Systems
Lab Experiment #1
Instructor: Dr. Michael Weeks

Blinking lights

This lab will introduce you to the Arduino.

When you learn a new programming language, one of the first things you typically do is try a "hello world" program. When working with a new hardware platform, we have a similar first exercise to make a light blink. It shows that you have control over the environment, and can make something happen. It also gives you a way to communicate from your control software. If nothing else, you can turn a light on/off to indicate that your software is working.

All code that you write must have your name in it, and must be commented. If you use someone else'e code, put that in the comments, and indicate what you did (e.g. "based on code by", "heavily modified from code by", "modified from code by", "lightly modified from code by", "inspired by", "slightly altered from code by", etc.). If you use someone else's code, add his/her/their name(s) to the comments along with other identifying information, such as where you downloaded it.

Complete the tutorial linked below. Do not plug the LED directly into the Arduino. Instead, put the LED and resistor into the breadboard, and wire it to the Arduino.
Blinking LED tutorial (Blink)
Once you have completed the blinking LED tutorial, try the Fade LED tutorial (Fade).

Questions

The Blink or Fade before the question designates which tutorial the question addresses.
  1. (Blink) Does your Arduino have an LED attached to pin 13? If so, did it blink along with the other LED? Why (or why not)?
  2. (Blink) How would you change the code to make the LED off for 2 seconds, then on for half a second?
  3. (Blink) How would you change the code to make the LED blink on for one second, then off for one second, then on for two seconds, then off for two seconds, then repeat?
  4. (Blink) Suppose that the LED is connected to pin 10. How would you change the code to make it work?
  5. (Fade) What is the difference between the analogWrite and digitalWrite commands?
  6. (Fade) Briefly describe what you observe when the delay is 30 units. If you change the delay from 30 to 600, what do you observe when you run it?


What to Turn In

Follow the directions on Lab Report format, given on the class web-page. Write-up what you did IN YOUR OWN WORDS. Do not simply re-word the directions, but explain what is going on. Avoid listing steps. Use outside sources as appropriate, and be certain to cite your sources. If you copy and paste ANY text, put it in double-quotes and include a citation immediately after it.

Please see the link to the lab format.