Metro Express - Either I or the Board is Terribly Inadequate

Please tell us which board you are 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
HenryM
 
Posts: 7
Joined: Mon Jun 23, 2014 12:36 pm

Metro Express - Either I or the Board is Terribly Inadequate

Post by HenryM »

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

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

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

User avatar
mikeysklar
 
Posts: 13828
Joined: Mon Aug 01, 2016 8:10 pm

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

Post by mikeysklar »

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

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

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

Post by HenryM »

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.

User avatar
mikeysklar
 
Posts: 13828
Joined: Mon Aug 01, 2016 8:10 pm

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

Post by mikeysklar »

@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

$ cat boot_out.txt 
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather RP2040 with rp2040
Board ID:adafruit_feather_rp2040

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

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

Post by HenryM »

Contents of boot_out.txt:

Code: Select all

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 503 times

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

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

Post by HenryM »

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.

User avatar
danhalbert
 
Posts: 4615
Joined: Tue Aug 08, 2017 12:37 pm

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

Post by danhalbert »

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`.

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

Return to “Metro, Metro Express, and Grand Central Boards”