Created
December 19, 2020 10:57
-
-
Save yemreeke/19fa94ae255cd6abf3c921326485114e to your computer and use it in GitHub Desktop.
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 LedPin=7,PirPin=8; | |
int BuzzerPin=9,Hareket; | |
void setup() { | |
pinMode(BuzzerPin,OUTPUT); | |
pinMode(LedPin,OUTPUT); | |
pinMode(PirPin,INPUT); | |
} | |
void loop() { | |
Hareket = digitalRead(PirPin); //Değer Okuduk | |
if(Hareket==HIGH){ //Hareket Var ise | |
digitalWrite(LedPin,HIGH);//Led Açıldı | |
tone(BuzzerPin, 660); //Kapı Zili | |
delay(700); //Açıldı | |
tone(BuzzerPin, 550); | |
delay(700); | |
tone(BuzzerPin, 440); //Kapı Zili | |
delay(700); //Kapandı | |
noTone(BuzzerPin); | |
digitalWrite(LedPin,LOW);//Led Kapandı | |
} | |
delay(500); // 0.5 sn bekle | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment