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 davida on Sun, 09/07/2008 - 22:24

Assignment: Introduction to Arduino and Physical Computing

Collaborators:

 

<!--[if gte vml 1]> <![endif]--><!--[if !vml]--><!--[endif]-->

Description:

A project that uses the Arduino board and programming environment to demonstrate how to make an LED blink according to a programmable interval.

Components List:

  • Light Emitting Diode (LED)
  • Resistor (220 Ohm)
  • Breadboard
  • Arduino board
  • Laptop running Arduino 11
  • Power came from computer via USB Cable
  • Two rubber bands (to secure boards together)

Notes:

I used the Blink tutorial code found in the Arduino software distribution. One difference from spec: I attached the LED directly to ground, as I did not have an elegantly sized connecting wire.

Acknowledgments:

With Michael’s insight I was able to finish smoothly and without any glitches.

Code used in this Assignment:

 

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

}