#LESSON 02-LED CHASER
CODE
/* LED CHASER
https://electronicassit.blogspot.in/
ARJUN ARANGIL
9444868542 */
int i,j;
void setup()
{
i=25; // blinking time
j=60; //blinking time
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop(){
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(3, HIGH);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(5, HIGH);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(7, HIGH);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(9, HIGH);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(11, HIGH);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(13, HIGH);
delay(j);
digitalWrite(2,LOW);
delay(i);
digitalWrite(3,LOW);
delay(j);
digitalWrite(4,LOW);
delay(i);
digitalWrite(5,LOW);
delay(j);
digitalWrite(6,LOW);
delay(i);
digitalWrite(7,LOW);
delay(j);
digitalWrite(8,LOW);
delay(i);
digitalWrite(9,LOW);
delay(j);
digitalWrite(10,LOW);
delay(i);
digitalWrite(11,LOW);
delay(j);
digitalWrite(12,LOW);
delay(i);
digitalWrite(13,LOW);
delay(j);
digitalWrite(13,HIGH);
delay(i);
digitalWrite(2,HIGH);
delay(j);
digitalWrite(12,HIGH);
delay(i);
digitalWrite(3,HIGH);
delay(j);
digitalWrite(11,HIGH);
delay(i);
digitalWrite(4,HIGH);
delay(j);
digitalWrite(10,HIGH);
delay(i);
digitalWrite(5,HIGH);
delay(j);
digitalWrite(9,HIGH);
delay(i);
digitalWrite(6,HIGH);
delay(j);
digitalWrite(8,HIGH);
delay(i);
digitalWrite(7,HIGH);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(3, HIGH);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(5, HIGH);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(7, HIGH);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(9, HIGH);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(11, HIGH);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(13, HIGH);
delay(j);
digitalWrite(13,LOW);
delay(i);
digitalWrite(12,LOW);
delay(j);
digitalWrite(11,LOW);
delay(i);
digitalWrite(10,LOW);
delay(j);
digitalWrite(9,LOW);
delay(i);
digitalWrite(8,LOW);
delay(j);
digitalWrite(7,LOW);
delay(i);
digitalWrite(6,LOW);
delay(j);
digitalWrite(5,LOW);
delay(i);
digitalWrite(4,LOW);
delay(j);
digitalWrite(3,LOW);
delay(i);
digitalWrite(2,LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(12, HIGH);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(10, HIGH);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(8, HIGH);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(6, HIGH);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(4, HIGH);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(2, HIGH);
delay(j);
digitalWrite(13,LOW);
delay(i);
digitalWrite(2,LOW);
delay(j);
digitalWrite(12,LOW);
delay(i);
digitalWrite(3,LOW);
delay(j);
digitalWrite(11,LOW);
delay(i);
digitalWrite(4,LOW);
delay(j);
digitalWrite(10,LOW);
delay(i);
digitalWrite(5,LOW);
delay(j);
digitalWrite(9,LOW);
delay(i);
digitalWrite(6,LOW);
delay(j);
digitalWrite(8,LOW);
delay(i);
digitalWrite(7,LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(12, HIGH);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11,LOW);
delay(j);
digitalWrite(12,LOW);
delay(i);
digitalWrite(13,LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(9, HIGH);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8,LOW);
delay(j);
digitalWrite(9,LOW);
delay(i);
digitalWrite(10,LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(6, HIGH);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5,LOW);
delay(j);
digitalWrite(6,LOW);
delay(i);
digitalWrite(7,LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(3, HIGH);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2,LOW);
delay(j);
digitalWrite(3,LOW);
delay(i);
digitalWrite(4,LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(13, HIGH);
delay(i);
digitalWrite(13, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(12, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(11, HIGH);
delay(i);
digitalWrite(11, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(10, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(9, HIGH);
delay(i);
digitalWrite(9, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(8, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(7, HIGH);
delay(i);
digitalWrite(7, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(6, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(5, HIGH);
delay(i);
digitalWrite(5, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(4, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(3, HIGH);
delay(i);
digitalWrite(3, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(2, LOW);
delay(j);
digitalWrite(2, HIGH);
delay(i);
digitalWrite(3, HIGH);
delay(j);
digitalWrite(4, HIGH);
delay(i);
digitalWrite(5, HIGH);
delay(j);
digitalWrite(6, HIGH);
delay(i);
digitalWrite(7, HIGH);
delay(j);
digitalWrite(8, HIGH);
delay(i);
digitalWrite(9, HIGH);
delay(j);
digitalWrite(10, HIGH);
delay(i);
digitalWrite(11, HIGH);
delay(j);
digitalWrite(12, HIGH);
delay(i);
digitalWrite(13, HIGH);
delay(j);
digitalWrite(2, LOW);
delay(i);
digitalWrite(2, HIGH);
delay(j);
digitalWrite(3, LOW);
delay(i);
digitalWrite(3, HIGH);
delay(j);
digitalWrite(4, LOW);
delay(i);
digitalWrite(4, HIGH);
delay(j);
digitalWrite(5, LOW);
delay(i);
digitalWrite(5, HIGH);
delay(j);
digitalWrite(6, LOW);
delay(i);
digitalWrite(6, HIGH);
delay(j);
digitalWrite(7, LOW);
delay(i);
digitalWrite(7, HIGH);
delay(j);
digitalWrite(8, LOW);
delay(i);
digitalWrite(8, HIGH);
delay(j);
digitalWrite(9, LOW);
delay(i);
digitalWrite(9, HIGH);
delay(j);
digitalWrite(10, LOW);
delay(i);
digitalWrite(10, HIGH);
delay(j);
digitalWrite(11, LOW);
delay(i);
digitalWrite(11, HIGH);
delay(j);
digitalWrite(12, LOW);
delay(i);
digitalWrite(12, HIGH);
delay(j);
digitalWrite(13, LOW);
delay(i);
digitalWrite(13, HIGH);
delay(j);
digitalWrite(13,LOW);
delay(i);
digitalWrite(12,LOW);
delay(j);
digitalWrite(11,LOW);
delay(i);
digitalWrite(10,LOW);
delay(j);
digitalWrite(9,LOW);
delay(i);
digitalWrite(8,LOW);
delay(j);
digitalWrite(7,LOW);
delay(i);
digitalWrite(6,LOW);
delay(j);
digitalWrite(5,LOW);
delay(i);
digitalWrite(4,LOW);
delay(j);
digitalWrite(3,LOW);
delay(i);
digitalWrite(2,LOW);
delay(j);
}
thank you berry much for the help , learning and code
ReplyDeleteI`m try to understen the pic 16f84A , 16F628 for led chaser diagram and code with 12 leds.if you work with that in a future video please let me know
ReplyDelete