Hi everyone, today i will show you how to use your arduino board to create a sequence LED blinking project.
Components required
- Arduino Board(Any).
- 5 x LEDs
- 5 x 220 ohm Resistors
- Breadboard and connection wires.
Circuit and Connections.
- Pin 12 to LED1 +ve
- Pin 11 to LED2 +ve
- Pin 10 to LED3 +ve
- Pin 9 to LED4 +ve
- Pin 8 to LED5 +ve
- -ve pin of LEDs to ground with 220 ohm resistor.
Coding
void setup() {
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
}
void loop() {
digitalWrite(12, HIGH);
delay(1000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
}
Done
No comments