IR

IR NEC Mode

This API is only applicable to master devices with integrated IR transmitters (e.g., StickC/C Plus/ATOM LITE/MATRIX).

from m5stack import *

#Send Data
#ir.tx(addr, data)
ir.tx(111, 23)

IR Unit

For other master devices that require IR reception and transmission functions, they can be implemented through the expansion peripheral IR Unit and used through the following API.


import unit

ir0 = unit.get(unit.IR_NEC, unit.PORTA)

data = None
addr = None

#Receive Callback
def ir_nec_rx_cb(_data, _addr, _ctrl):
  global data, addr
  data = _data
  addr = _addr
  print(data)
  print(addr)

#Set Receive Callback
ir0.rx_cb(ir_nec_rx_cb)

#Send Data
#ir.tx(addr, data)
ir.tx(111, 23)
On This Page