nbits throws exception when nbits is smaller that bytes*8
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Reproduce the failure with the example in nonblocking.py, then inspect the transmit logic around lines 380-382 of adafruit_irremote.py and the reported failure at line 403. Done means transmit accepts nbits=32 when the byte list contains more bits, avoids IndexError, and limits transmission to the requested bit count.
Written by the indexing model from the issue text.
Description
The following code generates the following exception
Code:
ir_tx_code = [0x00, 0xff, 0xaa, 0x55, 0x5A]
encoder.transmit(pulseout, ir_tx_code, nbits=32)
Exception:
Traceback (most recent call last):
File "nonblocking.py", line 31, in
File "adafruit_irremote.py", line 403, in transmit
IndexError: index out of range
The internal documentation suggests that the number of bits can be limited with the nbits option.
When used it throws a exception.
Lines 380, 381, 382 of the library should catch and adjust to enforce the option.
Bruce
- Dominant language
- Python
- Stars
- 29
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from adafruit/Adafruit_CircuitPython_IRRemote
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
adafruit/Adafruit_CircuitPython_IRRemote#76 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
adafruit/Adafruit_CircuitPython_IRRemote#74 · 1 reaction ·
-
Philips Tv's RC5 Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 1/5 Under an hour Newbie friendliness 52/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
adafruit/Adafruit_CircuitPython_IRRemote#70 · 1 comment ·
All issues in adafruit/Adafruit_CircuitPython_IRRemote
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100