Table of Contents

Infrared


IR decoder is fixed to pin 2 and 8.

  • Infrared.Enable(pin, enable) - Enables pin for IR signal capture
    pin: Pin number
    enable: True = enable, false = disable

  • Infrared.Read() - Reads the value from the IR enabled pin
    Return: Tracks the past 16 key presses and returns them. -1 if none.

This example will enable and read IR code from pin 2.

duelink.Infrared.Enable(2, True)

while True:
    x = duelink.Infrared.Read()
    if x >= 0:
        print (x)
        
    time.sleep(1)