0

Displaying simple text with GC M4 and 32x64 RGB Matrix
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Displaying simple text with GC M4 and 32x64 RGB Matrix

by kgrove on Fri Mar 19, 2021 9:22 pm

I'm very new to this and I've been going through some of these lessons.
CircuitPython Display Support Using displayio: Text https://learn.adafruit.com/circuitpython-display-support-using-displayio/text
RGB LED Matrices with CircuitPython: Simple two-line text scroller https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/example-simple-two-line-text-scroller

I've gotten the scroller to work, but I can't quite figure out how to just get some simple text to display. I'm at the point where I will gladly pay someone to help me better understand what I'm doing. Because between those two lessons, I'm not sure how to set up my matrix and how to plot out my text

The attached image is what I am more or less going for.

As far as my pinouts go for the RGB Matrix I have them setup as follows:
Code: Select all | TOGGLE FULL SIZE
matrix = rgbmatrix.RGBMatrix(
    width=64,
    height=32,
    bit_depth=1,
    rgb_pins=[
        board.D32,
        board.D33,
        board.D34,
        board.D35,
        board.D36,
        board.D37],
    addr_pins=[
        board.A12,
        board.A13,
        board.A14,
        board.A15],
    clock_pin=board.D27,
    latch_pin=board.D28,
    output_enable_pin=board.D26,
)


Any links that would steer me in the right direction would be SO helpful. Thanks in advance!
Kevin
Attachments
Screen Shot 2021-03-19 at 9.21.53 PM.png
Screen Shot 2021-03-19 at 9.21.53 PM.png (21.76 KiB) Viewed 93 times

kgrove
 
Posts: 50
Joined: Wed Feb 17, 2021 4:51 pm

Re: Displaying simple text with GC M4 and 32x64 RGB Matrix

by kgrove on Sat Mar 20, 2021 4:09 pm

I was able to modify the code from the text scroller example to get it to where I want.

Code: Select all | TOGGLE FULL SIZE
import adafruit_display_text.label
import time
import board
import displayio
import framebufferio
import rgbmatrix
import terminalio
from digitalio import DigitalInOut, Direction, Pull
from screens.game_mode_screen import build_game_mode_screen

displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
    width=64, height=32, bit_depth=1,
    rgb_pins=[
        board.D32,
        board.D33,
        board.D34,
        board.D35,
        board.D36,
        board.D37],
    addr_pins=[
        board.A12,
        board.A13,
        board.A14,
        board.A15],
    clock_pin=board.D27,
    latch_pin=board.D28,
    output_enable_pin=board.D26)
display = framebufferio.FramebufferDisplay(matrix, auto_refresh=False)

line1 = adafruit_display_text.label.Label(
    terminalio.FONT,
    color=0xff0000,
    text="Game Mode")
line1.x = 6
line1.y = 8

line2 = adafruit_display_text.label.Label(
    terminalio.FONT,
    color=0xff0000,
    text='Classic')
line2.x = 12
line2.y = 22

g = displayio.Group()
g.append(line1)
g.append(line2)

mode_button = DigitalInOut(board.D7)
mode_button.direction = Direction.INPUT
mode_button.pull = Pull.UP

game_mode = 1
edit = True

while True:
    if edit:
        display.show(g)
        display.refresh(minimum_frames_per_second=0)
        while not mode_button.value:
            if game_mode == 4:
                game_mode = 1
                build_game_mode_screen(g, game_mode)
                time.sleep(0.25)
            else:
                game_mode += 1
                build_game_mode_screen(g, game_mode)
                time.sleep(0.25)


kgrove
 
Posts: 50
Joined: Wed Feb 17, 2021 4:51 pm

Please be positive and constructive with your questions and comments.