Creating a Swastik style LED chaser using an Arduino Nano is a fascinating project that combines art and technology, allowing you to explore the realms of electronics and programming while producing a visually striking display. The Swastik symbol, with its rich cultural and historical significance, makes for a unique LED pattern that can bring vibrancy to any setting. In this project, you'll learn how to wire up multiple LEDs to your Arduino Nano, write a simple program to create a mesmerizing chaser effect, and gain hands-on experience with coding, circuit design, and troubleshooting. Whether you’re a beginner or an experienced maker, this guide will walk you through the entire process, from setup to execution, ensuring that you can create your own stunning LED display in no time. Let’s illuminate your creativity!
Here is the code below,-
void setup() {
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}
void loop() {
//effect 1
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
delay(1000);
//effect 2
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(50);
digitalWrite(i,LOW);
delay(50);
}
for (int i=5;i>=0; i--){
digitalWrite(i,HIGH);
delay(50);
digitalWrite(i,LOW);
delay(50);
}
for (int i=0;i<=5; i++){
digitalWrite(i,HIGH);
delay(50);
digitalWrite(i,LOW);
delay(50);
}
for (int i=5;i>=0; i--){
digitalWrite(i,HIGH);
delay(50);
digitalWrite(i,LOW);
delay(50);
}
delay(1000);
//effect 3
for (int i=0;i<=5; i++){
digitalWrite(i,LOW);
delay(100);
digitalWrite(i,HIGH);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,LOW);
delay(100);
digitalWrite(i,HIGH);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,LOW);
delay(100);
digitalWrite(i,HIGH);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,LOW);
delay(100);
digitalWrite(i,HIGH);
delay(100);
}
for (int i=0;i<=5; i++){
digitalWrite(i,LOW);
delay(100);
digitalWrite(i,HIGH);
delay(100);
}
delay(500);
}
Comments
Post a Comment