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.
-
you can connect multiple receivers, but why?jsotola– jsotola2018年04月23日 04:05:56 +00:00Commented Apr 23, 2018 at 4:05
-
But always only one of them, which is initialized last, is receiving the Data.Nijat2018– Nijat20182018年04月23日 04:47:12 +00:00Commented Apr 23, 2018 at 4:47
-
@jsotola you could use it to get a very coarse sense of the direction the signal came from.Gerben– Gerben2018年04月23日 09:14:30 +00:00Commented 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.Sanaullah Kayani– Sanaullah Kayani2020年04月08日 07:52:22 +00:00Commented 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.gerivega– gerivega2021年10月11日 15:22:15 +00:00Commented Oct 11, 2021 at 15:22
2 Answers 2
That library only supports one IR receiver at a time. Try this fork that seems to have added multiple receivers support.
Just add some delay between irrecv.decode()s and everything will work just fine.