Skip to content

Commit 3a90410

Browse files
authored
Merge pull request #33 from mfeif/master
Thank you for fixing this @mfeif!
2 parents 9dac962 + a2b5787 commit 3a90410

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,16 @@ Usage Example
6767
import pulseio
6868
import board
6969
import adafruit_irremote
70+
7071
pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True)
7172
decoder = adafruit_irremote.GenericDecode()
7273
73-
# size must match what you are decoding! for NEC use 4
74-
received_code = bytearray(4)
7574
7675
while True:
7776
pulses = decoder.read_pulses(pulsein)
7877
print("Heard", len(pulses), "Pulses:", pulses)
7978
try:
80-
code = decoder.decode_bits(pulses, debug=False)
79+
code = decoder.decode_bits(pulses)
8180
print("Decoded:", code)
8281
except adafruit_irremote.IRNECRepeatException: # unusual short code!
8382
print("NEC repeat!")

adafruit_irremote.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@
3232
import pulseio
3333
import board
3434
import adafruit_irremote
35+
3536
pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True)
3637
decoder = adafruit_irremote.GenericDecode()
3738
38-
# size must match what you are decoding! for NEC use 4
39-
received_code = bytearray(4)
4039
4140
while True:
4241
pulses = decoder.read_pulses(pulsein)

examples/irremote_simpletest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import pulseio
44
import board
55
import adafruit_irremote
6+
67
pulsein = pulseio.PulseIn(board.REMOTEIN, maxlen=120, idle_state=True)
78
decoder = adafruit_irremote.GenericDecode()
89

9-
# size must match what you are decoding! for NEC use 4
10-
received_code = bytearray(4)
1110

1211
while True:
1312
pulses = decoder.read_pulses(pulsein)

0 commit comments

Comments
 (0)