Skip to content

Adafruit SI1145 library throws error when exceeding UINT16 readings #12

Open
@costasvav

Description

@costasvav

I have an Adafruit SI1145 sensor. I have tested it on an Arduino Uno and it works great. I am shining a red laser on it for testing. The readings for infrared are in the 0-100,000 ballpark.

However, I switched over to CircuitPython on both a Pi Pico and FeatherS2. In both cases, when the reading exceeds 65,535, I get the following error (the first value is the IR reading from the sensor):

(305, 0, 100000)
(304, 0, 100000)
(303, 0, 100000)
(301, 0, 100000)
(304, 0, 100000)
(306, 0, 100000)
(303, 0, 100000)
(302, 0, 100000)
(300, 0, 100000)
(65535, 0, 100000)  <------ shine red laser on it
Traceback (most recent call last):
  File "code.py", line 16, in <module>
  File "/lib/adafruit_si1145.py", line 109, in als
  File "/lib/adafruit_si1145.py", line 165, in _send_command
RuntimeError: SI1145 Error: 0x80

Code done running.

Is this a programming problem where the value is stored in a UINT16 instead of something higher or some limitation in the Pico and ESP32 chips?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions