IR Unit
Support the following products:
Micropython Example:
1import os, sys, io 2import M5 3from M5 import * 4from unit import IRUnit 5import time 6 7 8ir_0 = None 9 10 11def setup(): 12 global ir_0 13 14 M5.begin() 15 Widgets.fillScreen(0x222222) 16 17 ir_0 = IRUnit((36, 26)) 18 19 20def loop(): 21 global ir_0 22 M5.update() 23 ir_0.tx(0, 0) 24 time.sleep(1) 25 26 27if __name__ == "__main__": 28 try: 29 setup() 30 while True: 31 loop() 32 except (Exception, KeyboardInterrupt) as e: 33 try: 34 from utility import print_error_msg 35 36 print_error_msg(e) 37 except ImportError: 38 print("please update to latest firmware")
UIFLOW2 Example:
class IR
Constructors
- class IR(IO1, IO2)
Create an IR object.
- The parameters is:
IO1,IO2Receive and transmit pin definitions.
UIFLOW2:

Methods
- ir.tx()
Sends an ir signal value to an address.
UIFLOW2:

- ir.rx_event()
Determine when the infrared signal is read and start to do some processing procedures.
UIFLOW2:


