void setup() {
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(4,OUTPUT);
pinMode(3,INPUT);
pinMode(5,INPUT);
}
void loop() {
if( digitalRead(3)==0){digitalWrite(2,1);digitalWrite(4,1);Serial.println(" Chiroqlar yondi");}
else {digitalWrite(2,0);digitalWrite(4,0);Serial.println("Chiroqlar ucdi");}
if(digitalRead(5)==1) {Serial.println("eshik ochiq ");}
else {Serial.println("eshik yopiq ");}
}
Do'stlaringiz bilan baham: |