Cannot load or use adafruit_circuitplayground library with my CPX boards

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
randychs
 
Posts: 2
Joined: Wed Nov 20, 2019 5:43 pm

Cannot load or use adafruit_circuitplayground library with my CPX boards

Post by randychs »

Hey folks, I'm trying to write my first CircuitPython programs, but they are not running as expected. Using https://code.circuitpython.org/, I can run a simple print(‘hello world’) program which displays output in the console. However I cannot seem to use adafruit_circuitplayground library. Running this simple program which just lights up to neopixels:

Code: Select all

SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
SPDX-License-Identifier: MIT
"""This example lights up the first and second NeoPixel, red and blue respectively."""
from adafruit_circuitplayground import cp

cp.pixels.brightness = 0.3

while True:
    cp.pixels[0] = (255, 0, 0)
    cp.pixels[1] = (0, 0, 255)
gives this error:

Code: Select all

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 5, in <module>
File "adafruit_circuitplayground/init.py", line 12, in <module>
File "adafruit_circuitplayground/express.py", line 75, in <module>
File "adafruit_circuitplayground/express.py", line 58, in init
File "adafruit_circuitplayground/circuit_playground_base.py", line 98, in init
File "adafruit_lis3dh.py", line 424, in init
File "adafruit_lis3dh.py", line 119, in init
File "adafruit_lis3dh.py", line 162, in data_rate
RuntimeError: maximum recursion depth exceeded

Code done running.
Even just trying to use the adafruit_circuitplayground library from the REPL gives a similar error:

Code: Select all

from adafruit_circuitplayground import cp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_circuitplayground/init.py", line 12, in <module>
File "adafruit_circuitplayground/express.py", line 75, in <module>
File "adafruit_circuitplayground/express.py", line 58, in init
File "adafruit_circuitplayground/circuit_playground_base.py", line 98, in init
File "adafruit_lis3dh.py", line 424, in init
File "adafruit_lis3dh.py", line 110, in init
File "adafruit_lis3dh.py", line 363, in _read_register_byte
RuntimeError: maximum recursion depth exceeded
>>>
I've loaded the most recent stable CircuitPython runtime for the CPX. Here's my boot.txt:

Code: Select all

Adafruit CircuitPython 8.1.0 on 2023-05-22; Adafruit CircuitPlayground Express with samd21g18
Board ID:circuitplayground_express
UID:E5D6F93B504352504A312E312A0403FF
Looking at the latest docs: https://docs.circuitpython.org/projects ... stallation, I shouldn't need to load any extra libraries for the above code. Even when I do put the latest adafruit_circuitplayground libs from adafruit-circuitpython-bundle-8.x-mpy-20230527 into the CPX /lib folder, I get the same results.
I also get the same results with the MU editor on my Windows machine.
Here's screenshop of my mounted CPX:
Image
Note this has also been crossposted to the Adafruit CircuitPython subforum

User avatar
lkdl
 
Posts: 3
Joined: Sun May 03, 2020 12:25 am

Re: Cannot load or use adafruit_circuitplayground library with my CPX boards

Post by lkdl »

I'm seeing the same issue

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: Cannot load or use adafruit_circuitplayground library with my CPX boards

Post by adafruit_support_bill »

Please do not double post: viewtopic.php?t=201761

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”