10X3W White LED Knight Rider Effect ( Arduino Uno)

Simple Project provide knight rider effect with help of 10X3W white LEDs and Arduino Uno, LED connected to D2 to D11 pins of Arduino. 

Download Arduino Code

Arduino Pins Vs LED

  • D2>>LED1
  • D3>>LED2
  • D4>>LED3
  • D5>>LED4
  • D6>>LED5
  • D7>>LED6
  • D8>>LED7
  • D9>>LED8
  • D10>>LED9
  • D11>>LED10

Watch  Video of This Project Here  

Arduino Code


/*
Simple code generate knight rider effect using 10 white LEDs,
Code presented  here is a modification of original code from electroschematics Author P-Marian

*/
int del=50; // sets a default delay time
void setup() {
// initialize the digital pins as outputs:
for (int i = 2; i<=11 ; i++) {
pinMode(i, OUTPUT);
} // end of for loop
} // end of setup

void loop() {
for (int i = 2; i<=11; i++) { // blink from LEDs 2 to 11
digitalWrite(i, HIGH);
delay(del);
digitalWrite(i, LOW);
}
for (int i = 11; i>=3; i–) { // blink from LEDs 11 to 3
digitalWrite(i, HIGH);
delay(del);
digitalWrite(i, LOW);
}
}

Leave a Reply

Your email address will not be published.