LED Blink (wk1)

ian's picture

Description

Modify LED Blink code.

Components

LED, 220Ω resistor.

Arduino Code



// Ian Leighton

// TUI 2011-08-31

/*
  modified 50ms version of:
  
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
  This example code is in the public domain.
 */

#define pin 13

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

void loop() {
  digitalWrite(pin, HIGH);   // set the LED on
  delay(50);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off
  delay(50);              // wait for a second
}

 

week1 circuit
0
Your rating: None