bool SW;char count=0;char tin=0;
void setup() {
pinMode(7,INPUT_PULLUP);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
Serial.begin(9600);
}
void loop() {
SW=digitalRead(7);
if(SW==LOW){
tin=0;
count++;
delay(300);
}
tin++;
if(tin==10){
tin=0;
if(count==1){
digitalWrite(5, HIGH);
count=0;
}
if(count==2){
digitalWrite(6, HIGH);
count=0;
}
if(count==3){
digitalWrite(6, LOW);
digitalWrite(5, LOW);
count=0;
}
if(count==4){
digitalWrite(6, HIGH);
digitalWrite(5, HIGH);
count=0;
}
}
Serial.print(tin,DEC);
Serial.print(" ");
Serial.print(count,DEC);
Serial.println(" wanasree 158");
delay(200);
}