0

I want to use #include <IRremote.h> to receive information from an infrared remote control. It works perfectly with one IR receiver.

But I want to put three or four IR receivers:

IRrecv irrecv6(pin6);
IRrecv irrecv7(pin7);
IRrecv irrecv8(pin8);
IRrecv irrecv9(pin9);
IRrecv irrecv10(pin10);

And:

void setup() {
  Serial.begin(9600);
  irrecv6.enableIRIn(); // Start the receiver
  irrecv7.enableIRIn(); // Start the receiver
  irrecv8.enableIRIn(); // Start the receiver
  irrecv9.enableIRIn(); // Start the receiver
  irrecv10.enableIRIn(); // Start the receiver
}

Inside the loop function, I am checking each pin to see if there is any data received. But only the last pin (which means pin 10 above) is receiving the data and others are not.

5
  • you can connect multiple receivers, but why? Commented Apr 23, 2018 at 4:05
  • But always only one of them, which is initialized last, is receiving the Data. Commented Apr 23, 2018 at 4:47
  • @jsotola you could use it to get a very coarse sense of the direction the signal came from. Commented Apr 23, 2018 at 9:14
  • did you find the solution, because i also want to put 4 ir receiver on Arduino in my fyp. if you have a solution plz help mee. Commented Apr 8, 2020 at 7:52
  • Try my link github.com/gerivega/Arduino-IRremote I wanted to do the same thing. I modified the latest library to incorporate the changes done by a previous programmer neco777. Commented Oct 11, 2021 at 15:22

2 Answers 2

3

That library only supports one IR receiver at a time. Try this fork that seems to have added multiple receivers support.

0

Just add some delay between irrecv.decode()s and everything will work just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.