Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Arnov Sharma
Published © MIT

LED Tower

Made a LED tower with 180 LEDs and used Pro Micro in order to control them in sequence.

AdvancedFull instructions provided5 hours7,258

Things used in this project

Story

Read more

Schematics

SCH for LED Matrix

Code

Chaser sketch

C/C++
int pinsCount=10;                        // declaring the integer variable pinsCount
int pins[] = {2,3,4,5,6,7,8,9,10,16};          // declaring the array pins[]


void setup() {                
  for (int i=0; i<pinsCount; i=i+1){    // counting the variable i from 0 to 9
    pinMode(pins[i], OUTPUT);       
    // initialising the pin at index i of the array of pins as OUTPUT
  }
}
 
void loop() {
  for (int i=0; i<pinsCount; i=i+1){    // chasing right
    digitalWrite(pins[i], HIGH);         // switching the LED at index i on
    delay(50);                          // stopping the program for 100 milliseconds
    digitalWrite(pins[i], LOW);          // switching the LED at index i off
  }
  for (int i=pinsCount-1; i>0; i=i-1){   // chasing left (except the outer leds)
    digitalWrite(pins[i], HIGH);         // switching the LED at index i on
    delay(50);                          // stopping the program for 100 milliseconds
    digitalWrite(pins[i], LOW);          // switching the LED at index i off
  }

{
    digitalWrite(2, LOW);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(16, LOW);
    delay(1000);
    digitalWrite(2, HIGH);
    digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
    digitalWrite(5, HIGH);
    digitalWrite(6, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);
    digitalWrite(10,HIGH);
    digitalWrite(16,HIGH);
    delay(1000);
    
}
}

Credits

Arnov Sharma
342 projects • 349 followers
I'm Arnov. I build, design, and experiment with tech—3D printing, PCB design, and retro consoles are my jam.
Contact

Comments

Please log in or sign up to comment.