User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Lab 01: Intro to A&PC: Blinking LED

Submitted by andy on Thu, 09/04/2008 - 12:02

Assignment: Introduction to Arduino and Physical Computing

Collaborators:

 

Blinking LED Breadboard

 

Description

Make a LED blink on the breadboard.

 

Components Used

  • LED (light-emitting diode)
  • Resister (220 ohm)

 

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(500);                  // waits for a half a second
digitalWrite(ledPin, LOW);    // sets the LED off
delay(250);                  // waits for a quarter second
}


Photograph

Blinking LED Board