@uktechguy
I can confirm that M5StickC has no receive, only IR Infrared transmit
A workaround, if you have a line follower (HW-006) or similar you can use a Grove2Dupont cable to connect the sensor to the M5StickC but (V. IMPORTANT!!!) swap the 5V input to the sensor with jumper cable to the 3V3 of the hat connector on the stick. This will allow a quick test of the receive block associated with the M5Stack IR module block in UIFlow.
What I discovered is that the standard transmit block (under Hardware > IR). Only accepts one byte for data and one byte for address. According to the NEC standard (not extended) the first 8 bits are the address and 17-24 bits are the command (NB 'data' is a bit of a loose term, it would be better as 'command' in the UIFlow block, datagram or 'data' to mean the assembled code).
Next gotcha, the bits need to be reversed to use with external equipment, note reversed not inversed. Tool for this: https://www.browserling.com/tools/reverse-binary
And this tool to swap between binary and hex
https://www.rapidtables.com/convert/number/binary-to-hex.html
An example:
The code I wanted to send: 0x00F7B04F --> the first byte is not the inverse binary of the second, so it is NEC extended and, so far as I can tell, is unsupported in UIFlow - ideally this needs fixed or second block added!
2nd attempt to use IR to turn on/off LG TV with book code: 0x20DF10EF
Logically, I took 20 to be the address and 10 to be the command ('data' in UIFlow block). Sadly, it wasn't. To make this work the addr and data values need to be reversed therefore 20 --> 0x04 and 10 --> 0x08.
Hence, I made the UIFlow block: IR(NEC) send addr 0x04 data 0x08 (alt Python ir.tx(0x04, 0x08)). Triggered from button on Atom this worked on my LG tvs.
Interestingly, send and receive between Atom and M5StickC didn't reverse the bits. So, I would assume the same would happen if using the receive to scan from a remote.
A couple of other examples:
https://flow.m5stack.com/?examples=ir_nec_sender_demo
https://flow.m5stack.com/?examples=ir_nec_receiver_demo
Some other useful references:
https://github.com/esikora/ESP32App_Led_IR/blob/PlatformIO/src/ESP32App_Led_IR.cpp
https://exploreembedded.com/wiki/NEC_IR_Remote_Control_Interface_with_8051
https://www.sbprojects.net/knowledge/ir/nec.php
https://qiita.com/poruruba/items/34220a4dd6aaf48392aa
https://docs.m5stack.com/en/unit/ir
https://shop.m5stack.com/products/stick-c