My project contains an obstacle detection circuit. I am building the circuit using ken shirriff's infrared library as he showed here. "Detecting an IR Beam Break with the Arduino IR Library". The original code by ken shirriff is posted below. The circuit is working perfectly when i connect the IR led to pin 3. But when i connect the IR led to pin 11 the IR led is not working. The only change i made to the code was change #define PIN_IR 3 to #define PIN_IR 11. If it is a silly mistake pls forgive me.
#include <IRremote.h>
#define PIN_IR 3
#define PIN_DETECT 2
#define PIN_STATUS 13
IRsend irsend;
void setup()
{
pinMode(PIN_DETECT, INPUT);
pinMode(PIN_STATUS, OUTPUT);
irsend.enableIROut(38);
irsend.mark(0);
}
void loop()
{
digitalWrite(PIN_STATUS, !digitalRead(PIN_DETECT));
}