Created
June 27, 2009 05:00
-
-
Save koki-h/136903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//9個のLEDを1個づつ光らせていく | |
//http://www.youtube.com/watch?v=7TdfvWGedBA | |
#define LED_PIN_MIN 2 | |
#define LED_PIN_MAX 10 | |
void setup() // run once, when the sketch starts | |
{ | |
for (int i = LED_PIN_MIN; i <= LED_PIN_MAX; i++){ | |
pinMode(i, OUTPUT); // sets the digital pin as output | |
} | |
} | |
void loop() // run over and over again | |
{ | |
for (int i = LED_PIN_MIN; i <= LED_PIN_MAX; i++){ | |
digitalWrite(i, HIGH); // sets the LED on | |
delay(1000); // waits for a second | |
digitalWrite(i, LOW); // sets the LED off | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment