// ======================================================================= // Arduino Sketch - cascade or triple blink LEDs // ======================================================================= // ---- setup function - runs once when you press reset or power the board void setup() { // initialize GIOs pinMode(13, OUTPUT); pinMode( 5, OUTPUT); pinMode( 6, OUTPUT); pinMode( 7, OUTPUT); pinMode( 8, OUTPUT); pinMode( 9, OUTPUT); // Initialize the serial port - Use one of these rates: // 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, // 38400, 57600, or 115200. Serial.begin(14400); } // ---- blink a LED void blink_led(int led) { //Serial.println("blink"); //Serial.flush(); digitalWrite(led, HIGH); // turn the LED on delay(300); // wait 3/10 second digitalWrite(led, LOW); // turn the LED off } // ---- Triple Blink a LED void triple_blink(int led) { blink_led(led); // first blink delay(500); // pause after blink blink_led(led); // second blink delay(500); // pause after blink blink_led(led); // third blink delay(1000); // final pause after blink } // ---- Triple Blink All LEDs void triple_blink_all() { //Serial.println("Triple blink all"); //Serial.flush(); triple_blink(13); triple_blink(5); triple_blink(6); triple_blink(7); triple_blink(8); triple_blink(9); } // ---- Cascade all LEDS void cascade_all() { //Serial.println("Cascade LED"); //Serial.flush(); blink_led(13); blink_led(5); blink_led(6); blink_led(7); blink_led(8); blink_led(9); } // ---- main loop - run forever void loop() { cascade_all(); //triple_blink_all(); }