I installed CircuitPython 6.3.0 on the Circuit Playground Express. I also created a lib folder on the CPE and dropped the adafruit_irremote.mpy from Bundle for Version 6.x in it.
I then placed this code into a code.py file on it:
Code: Select all
import board
import pulseio
import adafruit_irremote
pulseIn = pulseio.PulseIn(board.IR_RX, maxlen=120, idle_state=True)
decoder = adafruit_irremote.GenericDecode()
print("start")
while True:
pulses = decoder.read_pulses(pulseIn)
try:
received = decoder.decode_bits(pulses)
except adafruit_irremote.IRNECRepeatException:
print("Repeat Exception")
continue
except adafruit_irremote.IRDecodeException:
print("Decode Exception")
continue
except Exception as ex:
print("General Exception", ex)
continue
print("Code received", received)
Code: Select all
General Exception IRMessage(pulses=(6366, 251, 181, 241, 175, 191, 511, 249, 177, 273, 179, 214, 181, 271, 176, 2323, 175, 245, 181), reason='Pulses do not differ')
General Exception IRMessage(pulses=(179, 242, 174, 247, 179, 269, 178, 299, 179), reason='Too short')
General Exception IRMessage(pulses=(172,), reason='Too short')
Code received None
General Exception IRMessage(pulses=(178,), reason='Too short')
General Exception IRMessage(pulses=(179, 240, 176, 276, 197, 253, 205, 274, 179, 272, 175, 474, 181, 270, 177, 245, 181, 297, 311, 281, 181, 269, 178, 242, 174, 280, 178, 245, 182), reason='Pulses do not differ')
General Exception IRMessage(pulses=(174,), reason='Too short')
General Exception IRMessage(pulses=(179, 270, 177, 299, 179, 243, 172, 222, 173, 1685, 178, 724, 181, 1114, 176, 359, 182, 831, 178, 272, 175, 840, 206, 327, 177), reason='Only mark & space handled')