From be69e90d03ce9de1e2db92e8953d4b5daab36420 Mon Sep 17 00:00:00 2001 From: Matt Feifarek Date: Tue, 3 Mar 2020 15:48:49 -0600 Subject: [PATCH 1/2] Made example docs match working example file. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index bd8c29c..e388855 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ Usage Example 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!") From a2b5787108fc182cc624c3bf48b5d40f418fddc9 Mon Sep 17 00:00:00 2001 From: Matt Feifarek Date: Tue, 3 Mar 2020 15:52:41 -0600 Subject: [PATCH 2/2] removed unused code in example --- README.rst | 3 +-- adafruit_irremote.py | 3 +-- examples/irremote_simpletest.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index e388855..9127ef6 100644 --- a/README.rst +++ b/README.rst @@ -67,11 +67,10 @@ 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) 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)