User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

[Lab1] Blinking LED Breadboard

Submitted by sohyeong on Tue, 09/09/2008 - 00:28

Assignment: Introduction to Arduino and Physical Computing

Collaborators: sohyeong

Description

This lab required us to install the Arduino s/w and set up a circuit in order to blink an LED.  I used the sample code from the Arduino control s/w.  Although I am not familiar with this programing language, I was able to change some of variables in order to control the intervals of blinks of LED.  After compiling and uploading the modified code, the circuit board started blinking. By connecting Resistor to board, LED blinked.  You can find the photo from the attached file. 

Components Used

  • LED
  • Resistor
  • Breadboard
  • Arduino board
  • Computer installed the Arduino s/w

Arduino Code

 

/*

 * Blink

 *

 * The basic Arduino example.  Turns on an LED on for one second,

 * then off for one second, and so on...  We use pin 13 because,

 * depending on your Arduino board, it has either a built-in LED

 * or a built-in resistor so that you need only an LED.

 *

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

 */

 

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

 

void setup()                    // run once, when the sketch starts

{

  pinMode(ledPin, OUTPUT);      // sets the digital pin as output

}

 

void loop()                     // run over and over again

{

  digitalWrite(ledPin, HIGH);   // sets the LED on

  delay(1000);                  // waits for a second

  digitalWrite(ledPin, LOW);    // sets the LED off

  delay(1000);                  // waits for a second

}