User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Lab 1: Blinking LED Breadboard

Submitted by Seth Horrigan on Thu, 09/04/2008 - 11:57

Assignment: Introduction to Arduino and Physical Computing
Collaborators:
Description
Use the Arduino to control a light emitting diode and make it blink.
Components Used

  • Light Emitting Diode (LED)
  • Resistor
  • Wires
  • Human ingenuity

Arduino Code
/* * Blink */ int ledPin = 13; void setup(){ pinMode(ledPin, OUTPUT); } void loop(){ digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(200); for(int i = 0; i < 4; i++){ digitalWrite(ledPin, HIGH); delay(300); digitalWrite(ledPin, LOW); delay(100); } digitalWrite(ledPin, HIGH); delay(2000); digitalWrite(ledPin, LOW); delay(600); digitalWrite(ledPin, HIGH); delay(500); digitalWrite(ledPin, LOW); delay(100); for(int i = 0; i < 10; i++){ digitalWrite(ledPin, HIGH); delay(100); digitalWrite(ledPin, LOW); delay(75); } }
Image