Blink

Presently this is just the code required to get an LED to blink on and off. A full explanation will follow.

This is the most simple circuit we can build to demonstrate the digital output capabilities of the Arduino
This is the most simple circuit we can build to demonstrate the digital output capabilities of the Arduino

/*
* by Jeshua Maxey
* created 26/03/2013
*
* requirements:
*  - 1 x LED (with suitable resistor)
*
*  instructions for this sketch can be found at the following URL:
*  
*
*  This example code is in the public domain.
*
**************************************/

int led = 13;

void setup() {
  //set the pin of our led to be an output
  pinMode(led, OUTPUT);
}

void loop() {
  digitalWrite(led, HIGH); //turn the LED on
  delay(1000); //wait one second
  digitalWrite(led, LOW); //turn the LED off
  delay(1000); //wait one second
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s