//Digital Counter
//by Manish Kumar
void setup() {
pinMode(13,OUTPUT); //pin configuration
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
}
void loop() {
digitalWrite(13,0);//0
digitalWrite(12,0);
digitalWrite(11,0);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,1);//1
digitalWrite(12,0 );
digitalWrite(11,0 );
digitalWrite(10,0 );
delay(1000);
digitalWrite(13,0);//2
digitalWrite(12,1);
digitalWrite(11,0);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,1);//3
digitalWrite(12,1);
digitalWrite(11,0);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,0);//4
digitalWrite(12,0);
digitalWrite(11,1);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,1);//5
digitalWrite(12,0);
digitalWrite(11,1);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,0);//6
digitalWrite(12,1);
digitalWrite(11,1);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,1);//7
digitalWrite(12,1);
digitalWrite(11,1);
digitalWrite(10,0);
delay(1000);
digitalWrite(13,0);//8
digitalWrite(12,0);
digitalWrite(11,0);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,1);//9
digitalWrite(12,0);
digitalWrite(11,0);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,0);//10
digitalWrite(12,1);
digitalWrite(11,0);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,1);//11
digitalWrite(12,1);
digitalWrite(11,0);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,0);//12
digitalWrite(12,0);
digitalWrite(11,1);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,1);//13
digitalWrite(12,0);
digitalWrite(11,1);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,0);//14
digitalWrite(12,1);
digitalWrite(11,1);
digitalWrite(10,1);
delay(1000);
digitalWrite(13,1);//15
digitalWrite(12,1);
digitalWrite(11,1);
digitalWrite(10,1);
delay(1000);
}
Comments