Arduino Knight Rider Code




Arduino Knight Rider light effect, a simple variation of blink code.

Arduino Knight Rider




Instruction;
1) Connect all LED as diagram below, make sure cathode lead of LED at ground wire.

2) Connect all 330Ω resistor to anode lead of LED.

3) Connect all jumper wire to digital pin 12, 11, 10, 9 and 8.

Upload this code to your arduino

/*
  Knight Rider
  Create LED chasing effect as knight rider light.
  Coded by: arduinoprojects101.com
 */
void setup() {
  // initialize the digital pin 12, 11, 10, 9, 8 as an output.
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
}
void loop() {
  digitalWrite(12, HIGH);
  delay(80);
  digitalWrite(12, LOW);
  digitalWrite(11, HIGH);
  delay(80);
  digitalWrite(11, LOW);
  digitalWrite(10, HIGH);
  delay(80);
  digitalWrite(10, LOW);
  digitalWrite(9, HIGH);
  delay(80);
  digitalWrite(9, LOW);
  digitalWrite(8, HIGH);
  delay(80);
  digitalWrite(8, LOW);
  // reverse
  digitalWrite(8, HIGH);
  delay(80);
  digitalWrite(8, LOW);
  digitalWrite(9, HIGH);
  delay(80);
  digitalWrite(9, LOW);
  digitalWrite(10, HIGH);
  delay(80);
  digitalWrite(10, LOW);
  digitalWrite(11, HIGH);
  delay(80);
  digitalWrite(11, LOW);
  digitalWrite(12, HIGH);
  delay(80);
  digitalWrite(12, LOW);
}

Arduino Knight Rider Schematic

Major Components in Project

Parts List;
1) 5x 5mm red LED
2) 1x Arduino
3) 5x 330Ω resistor
4) Jumper wire

For more detail: Arduino Knight Rider Code




This Post / Project can also be found using search terms:

  • arduino knight rider code
  • self balancing robot pins connection
  • arduino real knight rider
  • Arduno kinght Raider led code
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Arduino Self-Balancing Robot
The Self-Balancing Robot using Arduino

Introduction The idea of this project was to design and construct a robot that consists of a body and two...

Close
Scroll to top