Skip to content

MatrixPortal M4 - ImportError: no module named 'platform' - CircuitPython 8.0.2 #7614

@csteamengine

Description

@csteamengine

CircuitPython version

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit Matrix Portal M4 with samd51j19

Code/REPL

import time
import board
import terminalio
from adafruit_matrixportal.matrixportal import MatrixPortal

# --- Display setup ---
matrixportal = MatrixPortal(status_neopixel=board.NEOPIXEL, debug=True)

# Create a new label with the color and text selected
matrixportal.add_text(
    text_font=terminalio.FONT,
    text_position=(0, (matrixportal.graphics.display.height // 2) - 1),
    scrolling=True,
)

SCROLL_DELAY = 0.03

contents = [
    { 'text': 'THIS IS RED',  'color': '#cf2727'},
    { 'text': 'THIS IS BLUE', 'color': '#0846e4'},
]

while True:
    for content in contents:
        matrixportal.set_text(content['text'])

        # Set the text color
        matrixportal.set_text_color(content['color'])

        # Scroll it
        matrixportal.scroll_text(SCROLL_DELAY)

Behavior

Traceback (most recent call last):
  File "code.py", line 4, in <module>
  File "/lib/adafruit_matrixportal/matrixportal.py", line 33, in <module>
  File "/lib/adafruit_matrixportal/network.py", line 31, in <module>
  File "adafruit_portalbase/network.py", line 28, in <module>
  File "/lib/adafruit_io/__init__.py", line 21, in <module>
  File "/lib/adafruit_io/client.py", line 24, in <module>
ImportError: no module named 'platform'

Description

This is the simplest example code from the MatrixPortal Circuitpython library found here:
https://docs.circuitpython.org/projects/matrixportal/en/latest/

I've copied all the suggested libraries into the lib/ directory on the CIRCUITPY drive, but can't get past this error.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsupportissues that involve helping a user accomplish a task

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions