binukadasunpriya
Published

Arduino knight rider light

This project is a cool project !, we can make the knight rider car scanner by using Arduino

BeginnerProtip3,343
Arduino knight rider light

Things used in this project

Hardware components

5 mm LED: Red
5 mm LED: Red
×10
Jumper wires (generic)
Jumper wires (generic)
×12
Through Hole Resistor, 180 ohm
Through Hole Resistor, 180 ohm
×10
Arduino UNO
Arduino UNO
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

led_marquees_bb_k0qyvjKvwp.jpg

Code

sketch_nov20a.ino

Arduino
/*

* ***************************  
  written : Binuka Dasunpriya
  date : 24th January 2021
  updated : 25th January 2021
  updated By : Binuka Dasunpriya
  Email : binukadasunpriya@gmail.com
  GitHub : https://github.com/BinukaDasunpriya

* ***************************  



 

* ***************************
we need : 12 jumper wires
        : 10 leds
        : A breadboard 
        : Arduino Uno/mega/nano board

Led pins : leds + = arduino 2-11
         : leds - = arduino Gnd


                          
* ***************************        
*/





void setup() {
  

  for(int pin = 2; pin < 12; pin ++){
  pinMode(pin,OUTPUT);
}
}

void loop() {
 int t = 20;

 for(int i = 2; i < 12; i++){
 digitalWrite(i,HIGH);
 delay(t);
 digitalWrite(i+1,HIGH);
 delay(t);
 digitalWrite(i+2,HIGH);
 delay(t);
 digitalWrite(i,LOW);
 delay(t);
 digitalWrite(i+1,LOW);
 
 }

 for(int i = 12; i > 1; i--){
 digitalWrite(i,HIGH);
 delay(t);
 digitalWrite(i-1,HIGH);
 delay(t);
 digitalWrite(i-2,HIGH);
 delay(t);
 digitalWrite(i,LOW);
 delay(t);
 digitalWrite(i-1,LOW);
 
 }

}

Credits

binukadasunpriya
3 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.