User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Assignment 1: Blinking LED

Submitted by bobacita on Mon, 09/08/2008 - 21:44

Assignment: Introduction to Arduino and Physical Computing

Collaborators:

Assignment: Introduction to Arduino and Physical Computing 

 

Description

Created a circuit consisting of an LED and a resistor and ran code to make the LED blink faster than the default of 1 second.  The LED was connected to pin 13.

 

Components Used

  • Resistor
  • LED (light emitting diode)
  • Wires for power and ground

 

Arduino Code

 

/*

 * 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(300);                  // waits for approximately 1/3 of a second

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

  delay(300);                  // waits for approximately 1/3 of a second

}

 

Item