You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
470 B
28 lines
470 B
11 years ago
|
const unsigned int LED_PIN = 13;
|
||
11 years ago
|
const unsigned int PAUSE = 700;
|
||
|
const unsigned int FLASH_DURATION = 100;
|
||
|
|
||
|
|
||
|
void flash(int n) {
|
||
11 years ago
|
for (int i = 0; i < n; i++) {
|
||
|
digitalWrite(LED_PIN, HIGH);
|
||
|
delay(FLASH_DURATION);
|
||
|
digitalWrite(LED_PIN, LOW);
|
||
|
delay(FLASH_DURATION);
|
||
|
}
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
|
|
||
|
void setup() {
|
||
11 years ago
|
pinMode(LED_PIN, OUTPUT);
|
||
11 years ago
|
}
|
||
|
|
||
|
|
||
|
void loop() {
|
||
11 years ago
|
for (int i = 1; i < 4; i++) {
|
||
|
flash(i);
|
||
|
delay(PAUSE);
|
||
|
}
|
||
11 years ago
|
delay(PAUSE);
|
||
11 years ago
|
}
|