Multiple IR recevers using IRLibrary
good day!
i'm having great trouble in using ir library multiple ir receivers.
i wanna make ir beacon consist of 4 ir receivers (i labeled them north, east, west south)
i'm making ir receiver beacon can process signal and
can tell ir receiver signal comes from.
heres code. xd
the image of result of code attached.
it cant figure out signal comes though remove ir receiver modules except 1.
help please! xd sorry bad english.
cheers!
i'm having great trouble in using ir library multiple ir receivers.
i wanna make ir beacon consist of 4 ir receivers (i labeled them north, east, west south)
i'm making ir receiver beacon can process signal and
can tell ir receiver signal comes from.
heres code. xd
code: [select]
#include <irremote.h>
int ir_north = 8;
int ir_east = 9;
int ir_west = 10;
int ir_south = 11;
irrecv ir_n(ir_north);
irrecv ir_e(ir_east);
irrecv ir_w(ir_west);
irrecv ir_s(ir_south);
decode_results n_results;
decode_results e_results;
decode_results w_results;
decode_results s_results;
void setup()
{
serial.begin(9600);
ir_n.enableirin();
ir_e.enableirin();
ir_w.enableirin();
ir_s.enableirin();
}
void loop()
{
if (ir_n.decode(&n_results))
{
serial.println("north");
serial.println(n_results.value, hex);
ir_n.resume();
}
if (ir_e.decode(&e_results))
{
serial.println("east");
serial.println(e_results.value, hex);
ir_e.resume();
}
if (ir_w.decode(&w_results))
{
serial.println("west");
serial.println(w_results.value, hex);
ir_w.resume();
}
if (ir_s.decode(&s_results))
{
serial.println("south");
serial.println(s_results.value, hex);
ir_s.resume();
}
}
the image of result of code attached.
it cant figure out signal comes though remove ir receiver modules except 1.
help please! xd sorry bad english.
cheers!
if leave unused inputs floating pick noise remaining receiver. try grounding unused inputs see if spurious results go away.
Arduino Forum > Using Arduino > Programming Questions > Multiple IR recevers using IRLibrary
arduino
Comments
Post a Comment