How to send and receive IR messages

 

Robot1 (sendMsg) will send IR message 255 when touch sensor 1 is pressed.

 

Robot2 (rcvMsg) is just waiting for IR Message 255. If it receives, it will make beep4.