adafruit / adafruit/Adafruit_CircuitPython_LTR390

Works fine on circuitpython but fails on micropython using blinka on Pico

Open
#17 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8
Forks
2
PR merge metrics
No merged PRs in 30d

Description

MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico W with RP2040
Type "help()" for more information.
>>> import busio
>>> import board
>>> import adafruit_ltr390
>>> i2c = busio.I2C(board.GP1, board.GP0)
>>> ltr = adafruit_ltr390.LTR390(i2c)
>>> print("UVI:", ltr.uvi, "\t\tAmbient Light:", ltr.lux)
Traceback (most recent call last):
File "", line 1, in
File "/lib/adafruit_ltr390.py", line 420, in uvi
File "/lib/adafruit_ltr390.py", line 353, in uvs
File "/lib/adafruit_ltr390.py", line 81, in __get__
TypeError: function doesn't take keyword arguments

Seems to be complaining about:
# read bytes into buffer at correct alignment
raw_value = unpack_from(self.format, self.buffer, offset=1)[0]

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure on the Raspberry Pi Pico W with MicroPython, then inspect adafruit_ltr390.py at lines 81, 353, and 420, especially the unpack_from call using offset=1. Compare the behavior with CircuitPython; done means the UVI and lux reads complete without the keyword-argument error on MicroPython.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.