const int IRSENSOR=5;
const int BUZZER=9;
const int LED=10;
void setup() {
// put your setup code here, to run once:
pinMode(IRSENSOR,INPUT);
pinMode(BUZZER,OUTPUT);
pinMode(LED,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int Data;
Data=digitalRead(IRSENSOR);
if(Data==1){
digitalWrite(BUZZER,HIGH);
digitalWrite(LED,HIGH);
}
else{
digitalWrite(BUZZER,LOW);
digitalWrite(LED,LOW);
}
}