int IrSensor=13;
int Led=2;
void setup() {
// put your setup code here, to run once:
pinMode(IrSensor,INPUT);
pinMode(Led,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int IrRead=digitalRead(IrSensor);
if(IrRead==0){
digitalWrite(Led,HIGH);
}
else{
digitalWrite(Led,LOW);
}
}