Posts

Showing posts from February, 2022

HOW TO DO 12 LED CHASER WITH 7 EFFECTS USING ARDUINO NANO

Image
  DIAGRAM  CODE  #define t   30 #define t1  20 #define t2  100 #define t3  50 void setup() {   // set up pins 2 to 13 as outputs   for (int i = 2; i <= 13; i++) {     pinMode(i, OUTPUT);   } } /////////////////////////////////////////////////////////////////////////////////Effect 1 void loop(){ effect_1(); effect_1();  effect_2();  effect_2();  effect_3();  effect_3();  effect_4();  effect_4();  effect_5();  effect_5();  effect_6();  effect_6();  effect_7();  effect_7();   } //left to right and right to left void effect_1() { for(int i=2; i<14; i++){ digitalWrite(i, HIGH); delay(t1); digitalWrite(i+1, HIGH); delay(t1); digitalWrite(i+2, HIGH); delay(t1); digitalWrite(i, LOW); delay(t1); digitalWrite(i+1, LOW); delay(t1); } for(int i=13; i>1; i--){ digitalWrite(i, HIGH); delay(t1); digitalWrite(i-1, HIGH); delay(t1); digitalWrite(i-2, HIGH); delay(t1)...