User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Lab 1: Introduction to Arduino - Programmable Blinking LED

Submitted by Laura Paajanen on Wed, 09/10/2008 - 20:15

 

Description

This project was to set up an Arduino board and program it to make an LED blink at set intervals.

Components Used

  • Arduino Board
  • Green LED
  • 220-ohm Resistor

Arduino Code

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