aboutsummaryrefslogtreecommitdiff
path: root/csource/Blink/Blink.cpp
blob: 1f97f77f6d0abb95871a3324be2e9f36f10577ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly. 
  This example code is in the public domain.
 */

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

#ifndef BOARD_LED
#define BOARD_LED 13
#endif

void setup();
void loop();

void setup() {
  pinMode(BOARD_LED, OUTPUT);
}

void loop() {
  digitalWrite(BOARD_LED, HIGH);   // set the LED on
  delay(1000);                     // wait for a second
  digitalWrite(BOARD_LED, LOW);    // set the LED off
  delay(500);                      // wait for a half a second
}