2-ways IR communication

Hello,

I have already a small robot which is controlled by ir.
I would like to improve this project by adding a servo and srf04 on the top of the robot in order to make a rotary sonar applet in Processing.
therefore, the robot should be able to both receive and transmit data.

I use the Ken Shirriff's IrRemote library.

I can't find a way to make my sketch works with receiving and transmitting. My harware works fine, i tested it by using each as transmitter and then receiver.
In ken Shirriff explication, i saw that the line for instance cancel the Ir receiver
irsend.sendSony(0xa90, 12); // send Sony TV power code
But, it seems to me thaht it can be reload by
irrecv.enableIRIn(); // Start the receiver

Well if Someone is familiar with this library or have a clue, it's welcome.

You cannot use IRremote for the concurrent receiving and sending of data, but you can switch between the two by calling enableIRIn/enableIROut before using the appropriate transfer direction.

Thanks for helping

but it's like is use enableIROut in a bad way, it's not in the Irremote library
error: 'class IRrecv' has no member named 'enableIROUT'

i wrote in the sketch irrecv.enableIROUT();

enableIROut is a method of IRsend not IRrecv. You have to call it on the appropriate object. Nevertheless it's the two objects are not independent, so you could use just either but not both of them.

Thanks, it works well ! :slight_smile:
There was a little trick, it's irsend.enableIROut(38), That'll teach me to read the all error message.