Motion detector
![[Pasted image 20230521180335.png|300]]
int buzzer = 11;
int sensor = 4;
int led = 13;
void setup()
{
Serial.begin(9200);
pinMode(buzzer, OUTPUT);
pinMode(sensor, INPUT);
pinMode(led, OUTPUT);
digitalWrite(buzzer,LOW);
digitalWrite(sensor,LOW);
digitalWrite(led,LOW);
}
void loop()
{
if(digitalRead(sensor) == HIGH){
Serial.println("SUCCESS");
digitalWrite(buzzer, HIGH);
}else{
Serial.println("FAIL");
digitalWrite(buzzer, LOW);
}
}