Aurdino LED Mini Project : Chasing LED Effect

Chasing LED Effect: Aurdino LED Mini Project for Engineers

What is Chasing LED Effect?

The LEDs connected to the Port of the microcontroller turns “ON” sequentially. This will be seen (visually) as the LEDs glow like chasing the next and so on.This creates a chasing LED effect in a single direction.

How does the project works?

Step 1 :

  • Initially connect LEDs of any number (in our project we use 8) in the microcontroller port.
  • Set the LED delay time as 65 seconds.
  • Set glowing direction as 1 and the current LED to be glow is ‘0’(i.e., the first LED of the array).

Step 2 : void setup():

  • Using the for loop,  we make each LED to turn ON one by one with a time delay.
  • This time delay depends on millis().
  • The LEDs are turn ON by setting them to the output port using pinMode().
  • Also set time as millis(). Here millis() returns the time since the program started.

Step 3 : void Loop():

  • Now we are going to put the entire algorithm for LED chasing effect within the method, loop().
  • Here we check if the” millis() -time”  is greater than the actual time delay , then change the glowing LED OFF and make next LED ON. This is  done using changeLED() method.

Step 4 : Method changeLED():

  • Again use for loop to turn off the LEDs one by one. After each LED gets turn OFF, the next LED becomes Current LED.
  • It glows and then the position of current LED changes to next.
  • If the current LED is the last one, then change the direction to -1. i.e., shifting left side starts from first LED.
  • If the current LED is the fist one, then change the direction to 1. i.e., shifting right side starts from first LED.

Aurdino Mini Project using LED : Chasing LED Effect Program coding

The output of the above code is given below:

Read More:

Arduino Mini Project For beginners: Automatic Traffic Signal Controller 
Electronics Mini Projects using OPAMP: Automatic Lamp ON project
Simple Arduino Project Serial Communication Demonstration Project
Try the above project… If you find any difficulties, please let me know though comments… Thanks for reading….

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *