Lab Assignment 1: Intro to Physical Computing

Submitted by bmcrae on Wed, 01/30/2013 - 15:45
bmcrae's picture

Description

A blinking LED circuit was created in this lab. I started by creating a simple circuit that started from PIN 13 of the Arduino Uno to the 220 ohm resistor to the blue LED to ground on the Arduino Uno. This is my full circuit for the blinking LED.

On the Arduino side, I used an Arduino Uno. I used the example "Blink" code provided by Arduino and modified it. Instead of using a delay of 1000, as provided in the original code, I changed the delay to 100. This increased the blinking frequency, and thus the LED blinks very fast compared to the original delay.

After making this modification, I uploaded the code to the Arduino Uno, and the LED blinks! This completes the blinking LED circuit lab. It's very interesting to see how with this code, one can make multiple LEDs to blink on a board at different rates.

Components Used

1 - Arduino Uno
1 - 220 ohm resistor
1 - Blue LED
1 - Breadboard
 

Code

/*
  Brian McRae
  Lab Assignment 1
  1/30/13
  
  Intro to Physical Computing
  Modified Code
  
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
 
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}
 
// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100);               // wait for a second
}
BlinkingLED_Circuit
0
Your rating: None
Drupal theme by Kiwi Themes.