How to Blink 3 LEDs Using Arduino

/*

Modifying the Blink sketch Attached 3 LEDs with 220 Ohms resistor */ int ledGreen = 12; // Green LED int ledYellow = 11; // Blue LED int ledRed = 10 ; // Red LED

// the setup routine runs once when you press reset: void setup() { // initialize the digital pins (12, 11, 10) as an output. pinMode(ledGreen, OUTPUT); pinMode(ledYellow, OUTPUT); pinMode(ledRed, OUTPUT); }

// the loop routine runs over and over again forever: void loop() { digitalWrite(ledGreen, HIGH); // turn the LED on delay(1000); // wait for a second digitalWrite(ledGreen, LOW); // turn the LED off delay(1000); // wait for a second digitalWrite(ledYellow, HIGH); // turn the LED on delay(1000); // wait for a second digitalWrite(ledYellow, LOW); // turn the LED off delay(1000); // wait for a second digitalWrite(ledRed, HIGH); // turn the LED on delay(1000); // wait for a second digitalWrite(ledRed, LOW); // turn the LED off delay(1000); // wait for a second }

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Fast & Easy Way to Learn How to Use Arduino Microcontroller

Be the First to Share

    Recommendations

    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    Discussions