Last active
October 28, 2019 07:15
-
-
Save RobolinkAkademi/f1295f0611b42888f156c02de04aaa81 to your computer and use it in GitHub Desktop.
tum_yil_icin_arduino_mufredati_17.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ses=2; //sensörün bağlandığı pin | |
int sesdurum=0; | |
void setup() | |
{ | |
pinMode(2,INPUT);//sensöre giriş sinyali gönderilmesi | |
} | |
void loop(){ | |
sesdurum=digitalRead(2);//sensörden okunan değerin sesdurum değiş. | |
//atanması | |
if(sesdurum == 1)//ses var ise(ses durumu 1 olduysa) | |
{ | |
digitalWrite(2,HIGH);//sensördeki pini yak | |
delay(2000);//2 saniye bekle | |
} | |
else | |
{ | |
digitalWrite(2,LOW);//sensördeki pini söndür | |
delay(2000);//2 saniye bekle | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment