// int latchPin=11;
// int clockPin=9;
// int dataPin=12;
// int dt=250;
// byte LED1s=0b11110000;
// byte LED2s=0b00001111; // led control using this
// void setup() {
// // pinMode(13, OUTPUT);
// // put your setup code here, to run once:
// Serial.begin(9600);
// pinMode(latchPin,OUTPUT);
// pinMode(dataPin,OUTPUT);
// pinMode(clockPin,OUTPUT);
// }
// void loop() {
// // digitalWrite(13, HIGH);
// // put your main code here, to run repeatedly:
// digitalWrite(latchPin,LOW);
// shiftOut(dataPin,clockPin,LSBFIRST,LED1s);
// digitalWrite(latchPin,HIGH);
// delay(dt);
// digitalWrite(latchPin,LOW);
// shiftOut(dataPin,clockPin,LSBFIRST,LED2s);
// digitalWrite(latchPin,HIGH);
// delay(dt);
// }
//// **********************new code*********************************
////printing BCD count (binary count)
int latchPin=11;
int clockPin=9;
int dataPin=12;
int dt=250;
byte LED1s=0b00000000;
// led control using this
void setup() {
// pinMode(13, OUTPUT);
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(latchPin,OUTPUT);
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
}
void loop() {
// digitalWrite(13, HIGH);
// put your main code here, to run repeatedly:
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,LSBFIRST,LED1s);
digitalWrite(latchPin,HIGH);
Serial.print(LED1s);
Serial.print(" ");
Serial.println(LED1s,BIN);
delay(110);
LED1s=LED1s + 1;
}
//// ************************new code******************************
//// printing right shift of eney given patten
// int latchPin=11;
// int clockPin=9;
// int dataPin=12;
// int dt=250;
// byte LED1s=0b00001000;
// // led control using this
// void setup() {
// // pinMode(13, OUTPUT);
// // put your setup code here, to run once:
// Serial.begin(9600);
// pinMode(latchPin,OUTPUT);
// pinMode(dataPin,OUTPUT);
// pinMode(clockPin,OUTPUT);
// }
// void loop() {
// // digitalWrite(13, HIGH);
// // put your main code here, to run repeatedly:
// digitalWrite(latchPin,LOW);
// shiftOut(dataPin,clockPin,LSBFIRST,LED1s);
// digitalWrite(latchPin,HIGH);
// Serial.println(LED1s,BIN);
// delay(500);
// // LED1s=LED1s/2;
// // LED1s=LED1s*2; // aa 3 samikaran muki joee jo
// LED1s=LED1s/128+LED1s*2;
// //
// }