Led chaser
How to make Led chaser Using Arduino
Components and supplies
1
Breadboard (generic)
1
Jumper wires (generic)
5
5 mm LED: Green
1
Arduino UNO
Project description
Code
Untitled file
arduino
Comments
Only logged in users can leave comments
Components and supplies
Breadboard (generic)
Jumper wires (generic)
5 mm LED: Green
Arduino UNO
Project description
Code
Untitled file
arduino
1#define LED0 4 2 3#define LED1 5 4 5#define LED2 6 6 7#define LED3 7 8 9#define LED4 8 10 11void setup() 12{ 13 pinMode(LED0, OUTPUT); 14 pinMode(LED1, OUTPUT); 15 pinMode(LED2, OUTPUT); 16 pinMode(LED3, OUTPUT); 17 pinMode(LED4, OUTPUT); 18 19} 20void loop() 21{ 22 23 digitalWrite(LED0,HIGH); 24 delay(200); 25 digitalWrite(LED0,LOW); 26 digitalWrite(LED1,HIGH); 27 delay(200); 28 digitalWrite(LED1,LOW); 29 digitalWrite(LED2,HIGH); 30 delay(200); 31 digitalWrite(LED2,LOW); 32 digitalWrite(LED3,HIGH); 33 delay(200); 34 digitalWrite(LED3,LOW); 35 digitalWrite(LED4,HIGH); 36 delay(200); 37 digitalWrite(LED4,LOW); 38 delay(200); 39 40 digitalWrite(LED4,HIGH); 41 delay(200); 42 digitalWrite(LED4,LOW); 43 digitalWrite(LED3,HIGH); 44 delay(200); 45 digitalWrite(LED3,LOW); 46 digitalWrite(LED2,HIGH); 47 delay(200); 48 digitalWrite(LED2,LOW); 49 digitalWrite(LED1,HIGH); 50 delay(200); 51 digitalWrite(LED1,LOW); 52 digitalWrite(LED0,HIGH); 53 delay(200); 54 digitalWrite(LED0,LOW); 55 delay(200); 56}
Comments
Only logged in users can leave comments