BlitzCityDIY / partyParrotAdventures

animating the party parrot gif as sprites with CircuitPython
6 stars 1 forks source link

Metro Express M4? #2

Open gallaugher opened 4 years ago

gallaugher commented 4 years ago

Liz - huge thanks for patience in helping me get this working. Looks like you were using a Feather M4. I've got a Matrix Shield and a Metro M4 Express. I'm ALMOST there, but there must be something slightly off in my configuration. reset what I think are the right configuration lines for the Metro M4 as follows (commented out the Feather M4 in your code for comparison):

rgb_pins=[board.D6, board.D5, board.D9, board.D11, board.D10, board.D12],

# addr_pins=[board.A5, board.A4, board.A3, board.A2],
# clock_pin=board.D13,
# latch_pin=board.D0,
# output_enable_pin=board.D1,
rgb_pins=[board.D2, board.D3, board.D4, board.D5, board.D6, board.D7],
addr_pins=[board.A0, board.A1, board.A2, board.A3],
clock_pin=board.A4,
latch_pin=board.D10,
output_enable_pin=board.D9,

Got these lines from here: https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/metro-m4-express

The bmp is somehow off a few pixels vertically. Unsure why. Here's a video: https://youtu.be/_HGtqONARbw Code at the learn URL above is for 64 x 32. Couldn't find one for 32, but I do have the width, height, bit depth set at: width=32, height=32, bit_depth=4, I'll definitely put up a newbie-focused build video pointing to your original work, if we can finally figure this out. Thanks!

gallaugher commented 4 years ago

Have been working with @foamguy on Discord & have been making mods. Getting closer, but the image is still not quite rendering properly. This code: https://gist.github.com/gallaugher/f7acfe51e2f57544e297948803bf40de

Gets me this: https://youtu.be/4SoqckKilrc

All are adafruit products. Have tried on two separate 32 x 32s - 5 mm and 6mm. Same result. I "think" I've got the shield soldered up right. Cut the jumper & soldered the wire as shown here: https://learn.adafruit.com/32x16-32x32-rgb-led-matrix/connecting-using-rgb-matrix-shield And I think those ribbon cables only go in one way.

gallaugher commented 4 years ago

So I've circled back & tried all of Adafruit's CircuitPython starter code for Metro M4 & LED Matrix, but I think there may be an error in the online docs. I've built two shields - used a multimeter to verify I cut the jumper for the Metro M4, and that continuity between CLK and A4 wire is sound. But even after building two LED Matrix Shields and testing on two separate 32 x 32 LED Matrix displays (one 5mm, one 6mm), the results are the same. I fully describe what I've done + offer a gist of code that should be properly modified given the Adafruit tutorials. Also share a brief video of the odd-looking results. https://forums.adafruit.com/viewtopic.php?f=47&t=170074&p=831499#p831499 So sorry to trouble you on this, Liz, but if there is a problem w/the code for the Metro M4 + Shield, hopefully I can surface this to someone who can make the change. Thx!

BlitzCityDIY commented 4 years ago

Hi! Sorry you're having these issues and also that I completely flaked that this was originally built with a Feather M4- I switched to an M4 airlift/shield setup to make this an IoT project for an upcoming Learn guide and just completely spaced. I'm going to test some code with my M4 express and shield and then drop that here. Also sorry for the delay in response- crazy day job week.

gallaugher commented 4 years ago

COMPLETELY no problem. You've been super nice to share your work. I am hoping that if there is something wrong with the library, that I might be able to surface this for someone to make the change. Since I built two shields + tried it with two different pitch Adafruit 32 x 32s, and even when modifying Adafruit's basic scrolling text tutorial there were squirrelly problems with horizontally flipped text that still didn't render right, I'm suspecting it may be a library issue or some incorrect info in the tutorial docs. Of course, a bonehead move by me is also quite possible. Cheers + don't at all feel bad for the delay. Things are hectic here, as well. All part of my learning journey :)

BlitzCityDIY commented 4 years ago

so i just had something very strange happen. using this code:

`import time from random import randint from micropython import const import board import digitalio import analogio import rgbmatrix import framebufferio import terminalio import adafruit_imageload import simpleio import displayio

parrot0 = 0 parrot1 = 1 parrot2 = 2 parrot3 = 3 parrot4 = 4 parrot5 = 5 parrot6 = 6 parrot7 = 7 parrot8 = 8 parrot9 = 9

displayio.release_displays() matrix = rgbmatrix.RGBMatrix( width=32, height=32, bit_depth=1, rgb_pins=[board.D2, board.D3, board.D4, board.D5, board.D6, board.D7], addr_pins=[board.A0, board.A1, board.A2, board.A3], clock_pin=board.A4, latch_pin=board.D10, output_enable_pin=board.D9, ) display = framebufferio.FramebufferDisplay(matrix)

group = displayio.Group(max_size=20)

parrot, parrot_pal = adafruit_imageload.load("/partyParrotsMatrix.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette)

parrot0_grid = displayio.TileGrid(parrot, pixel_shader=parrot_pal, width=1, height=1, tile_height=32, tile_width=32, default_tile=0, x=0, y=0)

group.append(parrot0_grid)

display.show(group)

party0 = 0 p = 0

while True: if (party0 + 0.1) < time.monotonic():

    parrot0_grid[0] = p

    p += 1
    party0 = time.monotonic()
    if p > 9:
        p = 0`

it worked as expected with a metro m4 airlift, but with a metro m4 express i had the exact same splitting/flipping issue that you're having...shield has the clock to A4 edit. tried powering with both USB and DC 5V/2A. going to try a couple of more things but wanted to share that. super weird.