RohanSardar
Published

Different Pattern Light Displaying Arrays project

This is a project compatible with any types of Arduino. I have used Arduino Nano. In this project different pattern of arrays are displayed.

BeginnerProtip1 hour1,945
Different Pattern Light Displaying Arrays project

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
LED (generic)
LED (generic)
×1
Male/Male Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Different Patterns Light Displaying Arrays

You can connect 12 LEDs from D2 to D11 and may upto D13.

Code

Different Patterns Light Displaying Arrays

C/C++
This is a good project for the kids and Arduino Beginners
int ledPins[] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; // an array of pin numbers to which LEDs are attached
int pinCount = 9;

void setup (){
 pinMode (1, OUTPUT);     // different led patterns
 pinMode (2, OUTPUT);
 pinMode (3, OUTPUT);
 pinMode (4, OUTPUT);
 pinMode (5, OUTPUT);
 pinMode (6, OUTPUT);
 pinMode (8, OUTPUT);
 pinMode (7, OUTPUT);
 pinMode (9, OUTPUT);
 pinMode (10, OUTPUT);
 pinMode (11, OUTPUT);
 pinMode (12, OUTPUT);
}

void loop (){
 digitalWrite (1, LOW);
 delay (60);
 digitalWrite (2, LOW);
 delay (59);
 digitalWrite (3, LOW);
 delay (58);
 digitalWrite (4, LOW);
 delay (57);
 digitalWrite (5, LOW);
 delay (56);
 digitalWrite (6, LOW);
 delay (55);
 digitalWrite (7, LOW);
 delay (54);
 digitalWrite (8, LOW);
 delay (53);
 digitalWrite (9, LOW);
 delay (52);
 digitalWrite (10, LOW);
 delay (51);
 digitalWrite (11, LOW);
 delay (50);
 digitalWrite (12, LOW);
 delay (49);
 digitalWrite (1, HIGH);
 delay (48);
 digitalWrite (2, HIGH);
 delay (47);
 digitalWrite (3, HIGH);
 delay (46);
 digitalWrite (4, HIGH);
 delay (45);
 digitalWrite (5, HIGH);
 delay (44);
 digitalWrite (6, HIGH);
 delay (43);
 digitalWrite (7, HIGH);
 delay (42);
 digitalWrite (8, HIGH);
 delay (41);
 digitalWrite (9, HIGH);
 delay (40);
 digitalWrite (10, HIGH);
 delay (39);
 digitalWrite (11, HIGH);
 delay (38);
 digitalWrite (12, HIGH);

 delay (37);
 digitalWrite (12, LOW);
 delay (60);
 digitalWrite (11, LOW);
 delay (59);
 digitalWrite (10, LOW);
 delay (58);
 digitalWrite (9, LOW);
 delay (57);
 digitalWrite (8, LOW);
 delay (56);
 digitalWrite (7, LOW);
 delay (55);
 digitalWrite (6, LOW);
 delay (54);
 digitalWrite (5, LOW);
 delay (53);
 digitalWrite (4, LOW);
 delay (52);
 digitalWrite (3, LOW);
 delay (51);
 digitalWrite (2, LOW);
 delay (50);
 digitalWrite (1, LOW);
 delay (49);
 digitalWrite (12, HIGH);
 delay (48);
 digitalWrite (11, HIGH);
 delay (47);
 digitalWrite (10, HIGH);
 delay (46);
 digitalWrite (9, HIGH);
 delay (45);
 digitalWrite (8, HIGH);
 delay (44);
 digitalWrite (7, HIGH);
 delay (43);
 digitalWrite (6, HIGH);
 delay (42);
 digitalWrite (5, HIGH);
 delay (41);
 digitalWrite (4, HIGH);
 delay (40);
 digitalWrite (3, HIGH);
 delay (39);
 digitalWrite (2, HIGH);
 delay (38);
 digitalWrite (1, HIGH);
 delay (37);

 digitalWrite (12, HIGH);
 delay (60);
 digitalWrite (11, HIGH);
 delay (59);
 digitalWrite (10, HIGH);
 delay (58);
 digitalWrite (9, HIGH);
 delay (57);
 digitalWrite (8, HIGH);
 delay (56);
 digitalWrite (7, HIGH);
 delay (55);
 digitalWrite (6, HIGH);
 delay (54);
 digitalWrite (5, HIGH);
 delay (53);
 digitalWrite (4, HIGH);
 delay (52);
 digitalWrite (3, HIGH);
 delay (51);
 digitalWrite (2, HIGH);
 delay (50);
 digitalWrite (1, HIGH);
 delay (49);
 digitalWrite (12, LOW);
 delay (48);
 digitalWrite (11, LOW);
 delay (47);
 digitalWrite (10, LOW);
 delay (46);
 digitalWrite (9, LOW);
 delay (45);
 digitalWrite (8, LOW);
 delay (44);
 digitalWrite (7, LOW);
 delay (43);
 digitalWrite (6, LOW);
 delay (42);
 digitalWrite (5, LOW);
 delay (41);
 digitalWrite (4, LOW);
 delay (40);
 digitalWrite (3, LOW);
 delay (39);
 digitalWrite (2, LOW);
 delay (38);
 digitalWrite (1, LOW);
 delay (37);



 digitalWrite (12, HIGH);
 delay (60);
 digitalWrite (10, HIGH);
 delay (59);
 digitalWrite (8, HIGH);
 delay (58);
 digitalWrite (6, HIGH);
 delay (57);
 digitalWrite (4, HIGH);
 delay (56);
 digitalWrite (2, HIGH);
 delay (55);
 digitalWrite (1, HIGH);
 delay (54);
 digitalWrite (3, HIGH);
 delay (53);
 digitalWrite (5, HIGH);
 delay (52);
 digitalWrite (7, HIGH);
 delay (51);
 digitalWrite (9, HIGH);
 delay (50);
 digitalWrite (11, HIGH);
 delay (49);
 digitalWrite (11, LOW);
 delay (48);
 digitalWrite (9, LOW);
 delay (47);
 digitalWrite (7, LOW);
 delay (46);
 digitalWrite (5, LOW);
 delay (45);
 digitalWrite (3, LOW);
 delay (44);
 digitalWrite (1, LOW);
 delay (43);
 digitalWrite (2, LOW);
 delay (42);
 digitalWrite (4, LOW);
 delay (41);
 digitalWrite (6, LOW);
 delay (40);
 digitalWrite (8, LOW);
 delay (39);
 digitalWrite (10, LOW);
 delay (38);
 digitalWrite (12, LOW);
 delay (37);




 digitalWrite (2, HIGH);
 delay (60);
 digitalWrite (4, HIGH);
 delay (59);
 digitalWrite (6, HIGH);
 delay (58);
 digitalWrite (8, HIGH);
 delay (57);
 digitalWrite (10, HIGH);
 delay (56);
 digitalWrite (12, HIGH);
 delay (55);
 digitalWrite (1, HIGH);
 delay (54);
 digitalWrite (3, HIGH);
 delay (53);
 digitalWrite (5, HIGH);
 delay (52);
 digitalWrite (7, HIGH);
 delay (51);
 digitalWrite (9, HIGH);
 delay (50);
 digitalWrite (11, HIGH);
 delay (49);
 digitalWrite (1, LOW);
 delay (48);
 digitalWrite (3, LOW);
 delay (47);
 digitalWrite (5, LOW);
 delay (46);
 digitalWrite (7, LOW);
 delay (45);
 digitalWrite (9, LOW);
 delay (44);
 digitalWrite (11, LOW);
 delay (43);
 digitalWrite (2, LOW);
 delay (42);
 digitalWrite (4, LOW);
 delay (41);
 digitalWrite (6, LOW);
 delay (40);
 digitalWrite (8, LOW);
 delay (39);
 digitalWrite (10, LOW);
 delay (38);
 digitalWrite (12, LOW);
 delay (37);




 digitalWrite (12, LOW);
 delay (60);
 digitalWrite (11, HIGH);
 delay (59);
 digitalWrite (10, LOW);
 delay (58);
 digitalWrite (9, HIGH);
 delay (57);
 digitalWrite (8, LOW);
 delay (56);
 digitalWrite (7, HIGH);
 delay (55);
 digitalWrite (6, LOW);
 delay (54);
 digitalWrite (5, HIGH);
 delay (53);
 digitalWrite (4, LOW);
 delay (52);
 digitalWrite (3, HIGH);
 delay (51);
 digitalWrite (2, LOW);
 delay (50);
 digitalWrite (1, HIGH);
 delay (49);
 digitalWrite (12, LOW);
 delay (48);
 digitalWrite (11, HIGH);
 delay (47);
 digitalWrite (10, LOW);
 delay (46);
 digitalWrite (9, HIGH);
 delay (45);
 digitalWrite (8, LOW);
 delay (44);
 digitalWrite (7, HIGH);
 delay (43);
 digitalWrite (6, LOW);
 delay (42);
 digitalWrite (5, HIGH);
 delay (41);
 digitalWrite (4, LOW);
 delay (40);
 digitalWrite (3, HIGH);
 delay (39);
 digitalWrite (2, LOW);
 delay (38);
 digitalWrite (1, HIGH);
 delay (37);




 digitalWrite (12, HIGH);
 delay (60);
 digitalWrite (11, LOW);
 delay (59);
 digitalWrite (10, HIGH);
 delay (58);
 digitalWrite (9, LOW);
 delay (57);
 digitalWrite (8, HIGH);
 delay (56);
 digitalWrite (7, LOW);
 delay (55);
 digitalWrite (6, HIGH);
 delay (54);
 digitalWrite (5, LOW);
 delay (53);
 digitalWrite (4, HIGH);
 delay (52);
 digitalWrite (3, LOW);
 delay (51);
 digitalWrite (2, HIGH);
 delay (50);
 digitalWrite (1, LOW);
 delay (49);
 digitalWrite (12, HIGH);
 delay (48);
 digitalWrite (11, LOW);
 delay (47);
 digitalWrite (10, HIGH);
 delay (46);
 digitalWrite (9, LOW);
 delay (45);
 digitalWrite (8, HIGH);
 delay (44);
 digitalWrite (7, LOW);
 delay (43);
 digitalWrite (6, HIGH);
 delay (42);
 digitalWrite (5, LOW);
 delay (41);
 digitalWrite (4, HIGH);
 delay (40);
 digitalWrite (3, LOW);
 delay (39);
 digitalWrite (2, HIGH);
 delay (38);
 digitalWrite (1, LOW);
 delay (37);




 digitalWrite (1, LOW);
 delay (60);
 digitalWrite (12, LOW);
 delay (59);
 digitalWrite (2, LOW);
 delay (58);
 digitalWrite (11, LOW);
 delay (57);
 digitalWrite (3, LOW);
 delay (56);
 digitalWrite (10, LOW);
 delay (55);
 digitalWrite (4, LOW);
 delay (54);
 digitalWrite (9, LOW);
 delay (53);
 digitalWrite (5, LOW);
 delay (52);
 digitalWrite (8, LOW);
 delay (51);
 digitalWrite (6, LOW);
 delay (50);
 digitalWrite (7, LOW);
 delay (49);
 digitalWrite (12, HIGH);
 delay (48);
 digitalWrite (1, HIGH);
 delay (47);
 digitalWrite (11, HIGH);
 delay (46);
 digitalWrite (2, HIGH);
 delay (45);
 digitalWrite (10, HIGH);
 delay (44);
 digitalWrite (3, HIGH);
 delay (43);
 digitalWrite (9, HIGH);
 delay (42);
 digitalWrite (4, HIGH);
 delay (41);
 digitalWrite (8, HIGH);
 delay (40);
 digitalWrite (5, HIGH);
 delay (39);
 digitalWrite (7, HIGH);
 delay (38);
 digitalWrite (6, HIGH);



 digitalWrite (12, LOW);
 delay (60);
 digitalWrite (1, LOW);
 delay (59);
 digitalWrite (11, LOW);
 delay (58);
 digitalWrite (2, LOW);
 delay (57);
 digitalWrite (10, LOW);
 delay (56);
 digitalWrite (3, LOW);
 delay (55);
 digitalWrite (9, LOW);
 delay (54);
 digitalWrite (4, LOW);
 delay (53);
 digitalWrite (8, LOW);
 delay (52);
 digitalWrite (5, LOW);
 delay (51);
 digitalWrite (7, LOW);
 delay (50);
 digitalWrite (6, LOW);
 delay (49);
 digitalWrite (1, HIGH);
 delay (48);
 digitalWrite (12, HIGH);
 delay (47);
 digitalWrite (2, HIGH);
 delay (46);
 digitalWrite (11, HIGH);
 delay (45);
 digitalWrite (3, HIGH);
 delay (44);
 digitalWrite (10, HIGH);
 delay (43);
 digitalWrite (4, HIGH);
 delay (42);
 digitalWrite (9, HIGH);
 delay (41);
 digitalWrite (5, HIGH);
 delay (40);
 digitalWrite (8, HIGH);
 delay (39);
 digitalWrite (6, HIGH);
 delay (38);
 digitalWrite (7, HIGH);
}

Credits

RohanSardar

RohanSardar

1 project • 1 follower
Thanks to Rohan Sardar.

Comments