adafruit / adafruit/Adafruit_CircuitPython_TSL2561
TSL2561 Chip id, part number, must 5? Code States That Datasheet is wrong?
- Dominant language
- Python
- Stars
- 4
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
I have several TSL2561 sensors that return part number as 4 not 5. Various other scripts and libraries work, some even explicitly test for part number as 4. but the adafruit library fails, stating the part number must be 5. I commented out the test for part number as 5, and the adafruit library works with my TSL2561 sensors. I have also seen references to various TSL2561 ICs that report part number 4, 5, even 6.
Edit is to /usr/local/lib/python3.9/dist-packages/adafruit_tsl2561.py, change illustrated below:
In def __init__...
comment out...
if not partno == 5:
insert:
if partno not in [4,5]:
This retains of course allows partno to be 4 or 5. Any comments or suggestions?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in adafruit_tsl2561.py, in the __init__ method where the TSL2561 part number is validated. Check how the part number is read and compare that validation with the issue's reported values, then run the existing project tests if available. Done means supported sensors reporting part number 4 or 5 initialize without the current rejection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100