Here is my code:
#include <IRremote.h>
#define PIN_IR 3 //ir led
#define PIN_DETECT 2 //receiver
#define PIN_STATUS 13 //output led
IRsend irsend;
void setup(){
pinMode(PIN_DETECT, INPUT);
pinMode(PIN_STATUS, OUTPUT);
irsend.enableIROut(38);
irsend.mark(0);
}
void loop(){
if(digitalRead(PIN_DETECT) == HIGH){
digitalWrite(PIN_STATUS, HIGH);
}else{
digitalWrite(PIN_STATUS, LOW);
}
}
Is there anything wrong with it? Because for some reason either the IR LED isn't emitting at 38 kH or the receiver isn't receiver it? The LED light (which is for the status) only stays off.