box-o-sand/oldstuff/arduino/msaqsg/ch01/HelloWorld/HelloWorld.ino
2015-06-22 13:15:42 -05:00

28 lines
470 B
C++

const unsigned int LED_PIN = 13;
const unsigned int PAUSE = 700;
const unsigned int FLASH_DURATION = 100;
void flash(int n) {
for (int i = 0; i < n; i++) {
digitalWrite(LED_PIN, HIGH);
delay(FLASH_DURATION);
digitalWrite(LED_PIN, LOW);
delay(FLASH_DURATION);
}
}
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
for (int i = 1; i < 4; i++) {
flash(i);
delay(PAUSE);
}
delay(PAUSE);
}