Rev Author Line No. Line
2934 jacho 1 /**
2 * Blink the Wiring board LED
3 * by BARRAGAN http://barraganstudio.com
4 *
5 * turns on and off the Wiring board LED, with
6 * intervals of 1 second (1000 milliseconds).
7 * For the Wiring boards v1 the on-board LED is on pin 48,
8 * on Wiring S the on-board LED is on pin 15.
9 * it is also possible to use the WLED constant with the
10 * digitalWrite command: digitalWrite(WLED, HIGH). WLED will be the
11 * correct pin in the current board selected in the
12 * Tools -> Board menu.
13 */
14  
15 // blinks the board LED, use 48 for Wiring 1.0 boards, use pin 15
16 // for Wiring S
17  
18 #include "WProgram.h"
19 void setup();
20 void loop();
21 void setup()
22 {
23 pinMode(2, OUTPUT); // set pin as output
24 }
25  
26 void loop()
27 {
28 digitalWrite(2, HIGH); // set the LED on
29 delay(1000); // wait for a second
30 digitalWrite(2, LOW); // set the LED off
31 delay(1000); // wait for a second
32 }
33