Skip to content

CLUE Light Painter :: bmp2led.py #2842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Conversation

mikeysklar
Copy link
Collaborator

@mikeysklar mikeysklar commented Jul 1, 2024

Single line change to accommodate different behavior with ulab processing arrays in CircuitPython 9.x. The example guide code had been failing after CP8.x.

BLE:Reconnecting | code.py | 9.0.5\Traceback (most recent call last):
  File "code.py", line 555, in <module>
  File "code.py", line 546, in run
  File "code.py", line 245, in load_image
  File "bmp2led.py", line 342, in process
OverflowError: value must fit in 1 byte(s)
BLE:Reconnecting | 342@bmp2led.py OverflowError | 9.0.5\

This has been tested with a CLUE nRF52840 on CP 9.0.5. Also with a CPB. Both myself and adafruit forum user JayPi have verified this stops the crashing and the code runs as expected.

# Convert float values in err to integers
err = [int(min(max(0, e), 255)) for e in err]

@mikeysklar mikeysklar merged commit b8e4a6a into main Jul 1, 2024
8 checks passed
@ladyada
Copy link
Member

ladyada commented Jul 2, 2024

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants