diff --git a/README.rst b/README.rst index bd8c29c..9127ef6 100644 --- a/README.rst +++ b/README.rst @@ -67,17 +67,16 @@ Usage Example import pulseio import board import adafruit_irremote + pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) decoder = adafruit_irremote.GenericDecode() - # size must match what you are decoding! for NEC use 4 - received_code = bytearray(4) while True: pulses = decoder.read_pulses(pulsein) print("Heard", len(pulses), "Pulses:", pulses) try: - code = decoder.decode_bits(pulses, debug=False) + code = decoder.decode_bits(pulses) print("Decoded:", code) except adafruit_irremote.IRNECRepeatException: # unusual short code! print("NEC repeat!") diff --git a/adafruit_irremote.py b/adafruit_irremote.py index 7e876d0..df4f00b 100644 --- a/adafruit_irremote.py +++ b/adafruit_irremote.py @@ -32,11 +32,10 @@ import pulseio import board import adafruit_irremote + pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) decoder = adafruit_irremote.GenericDecode() - # size must match what you are decoding! for NEC use 4 - received_code = bytearray(4) while True: pulses = decoder.read_pulses(pulsein) diff --git a/examples/irremote_simpletest.py b/examples/irremote_simpletest.py index 348f942..d72171f 100644 --- a/examples/irremote_simpletest.py +++ b/examples/irremote_simpletest.py @@ -3,11 +3,10 @@ import pulseio import board import adafruit_irremote + pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True) decoder = adafruit_irremote.GenericDecode() -# size must match what you are decoding! for NEC use 4 -received_code = bytearray(4) while True: pulses = decoder.read_pulses(pulsein)