Circuit Playground Express and Mini Remote Control

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
eat_sleep_code
 
Posts: 64
Joined: Sat Dec 30, 2017 1:30 am

Circuit Playground Express and Mini Remote Control

Post by eat_sleep_code »

I am tinkering with parts from an old AdaBox -- a Circuit Playground Express and Mini Remote Control [Product ID: 389].

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)
When I press the up button (several times), this is my output.

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')
Not once did I appear to receive a valid code. What is incorrect with my code -- for the most part it is pretty close to the example provided on the IR Test with Remote page.

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”