Arduino Blinky LED Intro

Program Download:

Main C File
Blink.ino
Blink_Mod.ino

The Software
           There are two programs to this software/firmware section:
    -Standard Blinky Program
    -Modified Dual Blinky Program



           The first program used is straight out of the Arduino's example library. We'll load it into the IDE, compile it and upload it to the Arduino. The program blinks the LED connected to digital output 13 every second.

LED Flasher Program

------------« Begin Code »------------
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}
------------« End Code »------------

           This second program will have a few simple modifications so that we can see LEDs being turned on and blinking from both digital output 12 and 13. The LEDs will alternate on and off, back and forth.

LED Flasher Program #2

------------« Begin Code »------------
/*
  Blink_Mod
  Alternates between two LEDs, turning one on and the other off, back and forther, over and over, repeatedly.

 */

void setup() {                
  // initialize the digital pins as an output.
  // Pin 12 has our 5mm LED connected,
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(12, LOW);
  digitalWrite(13, HIGH);   // set the LED on
  delay(500);              // wait for a second
  digitalWrite(12, HIGH);
  digitalWrite(13, LOW);    // set the LED off
  delay(500);              // wait for a second
}
------------« End Code »------------

           Now that we've looked at the schematic, theory, hardware and software...let's put it all together and test the system out in the next section.



;