Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Creative solution
Published

Knight Rider LED

Arduino beginner Tutorial of Led pattern control.

BeginnerFull instructions provided6,297
Knight Rider LED

Things used in this project

Hardware components

5 mm LED: Red
5 mm LED: Red
×1
Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

KNIGHT RIDER LED

Arduino
void setup() {
  // put your setup code here, to run once:
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
int t=200;//int is intiger(numerical value)
digitalWrite(5,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(5,LOW);

digitalWrite(6,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(6,LOW);

digitalWrite(7,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(7,LOW);

digitalWrite(8,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(8,LOW);

digitalWrite(9,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(9,LOW);
//PREVIOURS PIN

digitalWrite(8,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(8,LOW);

digitalWrite(7,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(7,LOW);

digitalWrite(6,HIGH);
delay(t);//t=200 t is a delay time
digitalWrite(6,LOW);// Now back to up
}

Credits

Creative solution
7 projects • 5 followers
Contact

Comments

Please log in or sign up to comment.