Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

Metro Express - Either I or the Board is Terribly Inadequate
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro Express - Either I or the Board is Terribly Inadequate

by HenryM on Mon Dec 06, 2021 8:04 pm

Edit: I'm using CircuitPython 7.0.0

My goal is to drive three 14-segment alphanumeric displays using a Metro Express M0 and, well, it just doesn't seem up to the challenge. Essentially, right now, I have a single neopixel (the one included on the board) and I'm trying to import the ht16k33 library. Here's my code:

main.py
Code: Select all | TOGGLE FULL SIZE
import board
import neopixel
import digitalio
import busio

from adafruit_ht16k33 import segments
i2c = busio.I2C(board.SCL, board.SDA)

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixel.brightness = 0.1

while True:
    pixel[0] = [255, 0, 0]
    time.sleep(0.1)
    pixel[0] = [0, 0, 0]
    time.sleep(0.9)
   


Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "main.py", line 7, in <module>
  File "adafruit_ht16k33/segments.py", line 392, in <module>
MemoryError: memory allocation failed, allocating 96 bytes

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Metro Express - Either I or the Board is Terribly Inadeq

by mikeysklar on Mon Dec 06, 2021 10:00 pm

HenryM,

Can you try loading the MPY library files (pre-compiled) for segements / neopixel. You had been calling the PY file which is larger. Also please make sure you are running CircuitPython 7.x

https://github.com/adafruit/Adafruit_Ci ... 211202.zip

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

Re: Metro Express - Either I or the Board is Terribly Inadeq

by HenryM on Tue Dec 07, 2021 8:40 am

As far as I know, I have been using the precompiled binaries. Everything within `adafruit-circuitpython-bundle-7.x-mpy-20211202/lib` is precompiled? And I do confirm that I've been using CircuitPython 7.0.0.

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Metro Express - Either I or the Board is Terribly Inadeq

by mikeysklar on Tue Dec 07, 2021 4:47 pm

@HenryM,

I have both bundles of source and compiled files. Since your error in the REPL had the source file extension of *.py versus the compiled extension of *.mpy I think you might be using the source files. Can you check your CIRCUITPY/lib folder to confirm what the file extensions are on your libraries?

In terms of how to verify the version of CircuitPython running on your device take a lok at CIRCUITPY/boot_out.py. It should look something like this:

Code: Select all | TOGGLE FULL SIZE
$ cat boot_out.txt
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather RP2040 with rp2040
Board ID:adafruit_feather_rp2040

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

Re: Metro Express - Either I or the Board is Terribly Inadeq

by HenryM on Tue Dec 07, 2021 6:17 pm

Contents of boot_out.txt:
Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Metro M0 Express with samd21g18
Board ID:metro_m0_express


The files within the `lib` directory are almost all .mpy. The only exceptions are within the subdirectories, there are a few 0 length __init__.py files
Attachments
ksnip_20211207-161317.png
ksnip_20211207-161317.png (66.09 KiB) Viewed 355 times

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Metro Express - Either I or the Board is Terribly Inadeq

by HenryM on Tue Dec 07, 2021 8:36 pm

I sincerely appreciate your suggestions mikeysklar. So thank you for the help.

For what its worth, I'm just going to do this project in Arduino mode. I didn't even intend to get something that would run CircuitPython, it was just something that was in stock and looked like it could easily handle what I want. When I saw that it was set up for CircuitPython by default, I decided to roll with it. I'm now using in "regular" Arduino mode and I'm able to pound the code out very quickly.

HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Re: Metro Express - Either I or the Board is Terribly Inadeq

by danhalbert on Wed Dec 08, 2021 10:14 am

Since your error in the REPL had the source file extension of *.py versus the compiled extension of *.mpy I think you might be using the source files.

The backtrace will say (somewhat misleadingly) `.py` even if the file is `.mpy`.

danhalbert
 
Posts: 2954
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.