└── new_arduino_test.pde /new_arduino_test.pde: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | 4 | Turns on an LED on for one second, then off for one second, repeatedly. 5 | 6 | The circuit: 7 | * LED connected from digital pin 13 to ground. 8 | 9 | * Note: On most Arduino boards, there is already an LED on the board 10 | connected to pin 13, so you don't need any extra components for this example. 11 | 12 | 13 | Created 1 June 2005 14 | By David Cuartielles 15 | 16 | http://arduino.cc/en/Tutorial/Blink 17 | 18 | based on an orginal by H. Barragan for the Wiring i/o board 19 | 20 | */ 21 | 22 | int ledPin = 13; // LED connected to digital pin 13 23 | 24 | // The setup() method runs once, when the sketch starts 25 | 26 | void setup() { 27 | // initialize the digital pin as an output: 28 | for(ledPin = 0; ledPin <= 13; ledPin++ ){ 29 | pinMode(ledPin, OUTPUT); 30 | } 31 | } 32 | 33 | // the loop() method runs over and over again, 34 | // as long as the Arduino has power 35 | 36 | void loop() 37 | { 38 | for(ledPin = 0; ledPin <= 13; ledPin++ ){ 39 | digitalWrite(ledPin, HIGH); // set the LED on 40 | delay(1000); // wait for a second 41 | digitalWrite(ledPin, LOW); // set the LED off 42 | } 43 | 44 | } 45 | --------------------------------------------------------------------------------