I moved your post to a new topic.
It is not entirely clear to me what you are trying to do with the IR beacons, but they are already programmed to receive and transmit. The IR beacon has four digital outputs to indicate which side it detects the other beacon. You can connect those outputs to any available digital I/O pins on your Arduino to read them. We do not have an Arduino library for the IR beacon, however, you should be able to use
digitalRead() to read whether each pin connected to the beacon is high or low. Then with that data control your Arduino robot accordingly.
You might find the Pololu IR Beacon Quick-Start Sheet helpful for understanding how the directional outputs work.