IR connection

If you expect the IR transmitter to know how to do something useful to "send" a '2', I'm afraid you are sadly mistaken.

If you expect the IR receiver to know how to convert a bunch of blinking to a '2', I'm afraid you are sadly mistaken.

You have to make the IR transmitter flash in some specific way, usually modulated on top of a 38 MHz carrier, that means '2'.

You have to make the IR receiver demodulate the data from the 38 MHz carrier, and decode the HIGH/LOW times to determine that they mean '2'.