Blinking LED

Description


The goal of this assignment was to install the Arduino software and drivers, wire up a simple circuit using a breadboard, and load a program onto Arduino.

I was able to accomplish all of this. First I went to the Arduino website (arduino.cc) and followed their instructions for "Getting Started" with Arduino. These steps are reproduced below:

  1. Get an Arduino board and cable
  2. Download the Arduino environment
  3. Install the USB drivers
  4. Connect the board
  5. Run the Arduino environment
  6. Upload a program
  7. Look for the blinking LED
  8. Learn to use Arduino

None of these steps presented any difficulties for me as the documentation on arduino.cc was very well presented. After completing this introduction I moved on to fulfill the requirements of this assignment by wiring Arduino to the LED according to the circuit shown in the problem statement and uploading my own blinking light program to Arduino. I felt a deep sense of satisfaction when I saw the blink-rate of the LED change according to the modifications I made to the example "Blink" code.

Components Used


The following components were used:
  • Arduino
  • Breadboard
  • Rubber band
  • USB cable
  • 3 jumper cables (small, medium, long)
  • 220 Ohm resistor
  • LED light

I had planned on following the recommended color code (using black for ground) but I only had one black jumper cable and didn't want to cut it. Also, my initial decision to use both rubber bands to secure Arduino to the breadboard got derailed when one of the rubber bands broke.

Arduino Code


/*
Blink

Turns on an LED on for one second, then off for one second, repeatedly.

The circuit:
* LED connected from digital pin 13 to ground.

* Note: On most Arduino boards, there is already an LED on the board
connected to pin 13, so you don't need any extra components for this example.

Created 1 June 2005
By David Cuartielles

Modified 9 September 2009
By Eric Mai
For i262 HW 1

http://arduino.cc/en/Tutorial/Blink

based on an original by H. Barragan for the Wiring i/o board

*/

int ledPin = 13; // LED connected to digital pin 13

// The setup() method runs once, when the sketch starts

void setup() {
// initialize the digital pin as an output:
pinMode(ledPin, OUTPUT);
}

// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()
{ digitalWrite(ledPin, HIGH); // set the LED on
delay(2000); // wait for two seconds
digitalWrite(ledPin, LOW); // set the LED off
delay(500); // wait for half of a second
}

Pictures


Light off:
Light off
Light on:
Light on
Simulation of what it was like:
Blinking Animation