Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

HAL 9000 Python Example not working with CPX + Crickit 5.1.0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

HAL 9000 Python Example not working with CPX + Crickit 5.1.0

by grok777 on Tue Apr 07, 2020 5:20 pm

I have an Adafruit Circuit Playground Express and a Crickit, and I would like to run Circuit Python to use the HAL 9000 code from this project page:
https://learn.adafruit.com/hal-9000-rep ... th-crickit

I have tried loading the Circuit Python special Circuit Playground Express + Crickit build from here, which is currently 5.1.0:
https://circuitpython.org/board/circuit ... s_crickit/

When I put the HAL code on my adafruit, I get the error that the adafruit_crickit library cannot be found. I feel like I am missing some simple thing to get this working. I was under the impression that if I run that build, my code can just load those libraries with "from adafruit_crickit import crickit". My code is at the root of the CIRCUITPY flash. Did the library name change? Has anyone tested the HAL example code on 5.1.0? Does that build have any other dependencies?

Any help would be greatly appreciated.

grok777
 
Posts: 2
Joined: Tue Apr 07, 2020 4:01 pm

Re: HAL 9000 Python Example not working with CPX + Crickit 5

by mikeysklar on Tue Apr 07, 2020 5:55 pm

Hello grok777,

It sounds like you need to install the 5.1.0 CircuitPython Library Bundle on your Cricket's CIRCUITPY drive under the lib/ folder. The libraries are either not in place or they are an older version. This page should help:

https://learn.adafruit.com/welcome-to-c ... -libraries

mikeysklar
 
Posts: 1243
Joined: Mon Aug 01, 2016 8:10 pm

Re: HAL 9000 Python Example not working with CPX + Crickit 5

by grok777 on Tue Apr 07, 2020 7:16 pm

Hi mikeysklar,
Thanks for the quick reply! I did try loading the standard Circuit Python build without the crickit extensions built in, and then I put the adafruit_motor, adafruit_seesaw, and adafruit_cricket libraries in the lib folder. When I did that, I got an out of memory error. From what I read in a github ticket and the FAQ for Crickit, the resolution of that problem should be to just use the Circuit Python build that already includes those libraries, which is what I was trying in the first place without success.

My directory structure looks like this at root. I completely deleted the lib folder:
/
adafruit-circuitpython-circuitplayground_express_crickit-en_US-5.1.0.uf2
code.py
hal1.wav
hal2.wav

When I connect to the console of the board I get the error:
Traceback (most recent call last):
File "code.py", line 6, in <module>
ImportError: no module named 'adafruit_crickit'

And here is line 6 of code.py:
from adafruit_crickit import crickit

grok777
 
Posts: 2
Joined: Tue Apr 07, 2020 4:01 pm

Re: HAL 9000 Python Example not working with CPX + Crickit 5

by mikeysklar on Tue Apr 07, 2020 7:58 pm

Hi grok777,

So there are two uf2 files.

The Crickit firmware seesaw-crickit.uf2 which needs to be named as such and placed on CRICKITBOOT:

https://learn.adafruit.com/adafruit-cri ... ur-crickit
https://github.com/adafruit/seesaw/releases/latest

The other uf2 file for your CPX requires a double click of the reset on the CPX and must be copied to the DRIVE named CPLAYBOOT (CIRCUITPY). You will need to remove the uf2 you currently have in place.

https://learn.adafruit.com/adafruit-cri ... ython-code

mikeysklar
 
Posts: 1243
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.