Created
December 10, 2020 08:14
-
-
Save yemreeke/5772503bfe3d6f2c293f45e13cb81b25 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 BuzzerPin=9; | |
int Led=8; | |
int LDR_Deger=0; | |
void setup(){ | |
pinMode(BuzzerPin,OUTPUT); | |
pinMode(Led,OUTPUT); | |
pinMode(A0,INPUT); | |
} | |
void loop(){ | |
LDR_Deger=analogRead(A0);//LDR Değer Okuduk | |
if(LDR_Deger<300){ //300'den küçükse | |
digitalWrite(Led,HIGH); //Led Yak | |
digitalWrite(BuzzerPin,HIGH); //Buzzer Aç | |
} | |
else{ //Büyükse kapat | |
digitalWrite(Led,LOW); | |
digitalWrite(BuzzerPin,LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment