marcmerlin / FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos

Various Arduino 2D demos that work all hardware backends supported by FrameBuffer::GFX
http://marc.merlins.org/perso/arduino/post_2020-03-16_Framebuffer_GFX_-Choosing-between-its-3-2D-APIs_-FastLED-XY_-NeoMatrix_-and-LEDMatrix_-and-detail-of-its-many-supported-hardware-backends.html
95 stars 19 forks source link

Changing the Matrix size from 64 x 64 to 128 x 128 #6

Open flasher69 opened 2 years ago

flasher69 commented 2 years ago

Hi Marc,

I wanted to ask you how do I have to modify the neomatrix_config.h file in order to change the matrix size from 64 x 64 to 128 x 128 or other dimensions. I'm using Teensy 3.5 and Smartmatrix shield.

Thank you for all your efforts and this great project.

cheers

marcmerlin commented 2 years ago

\Hi, didn't realize you were the same person from the other issue :)

First, make sure you get it working with just SmartMatrix, enough to init the matrix and write hello world or running https://github.com/pixelmatix/SmartMatrix/tree/master/examples/FeatureDemo

Also, as a tip, when you paste code, add a ``` ``` around it.

like this

:)

Once you have it working with Smartmatrix, in neomatrix_config.h, set

const uint16_t MATRIX_TILE_WIDTH = 128; 
const uint16_t MATRIX_TILE_HEIGHT = 128;

the tile stuff is used for neopixel matrices where pixels are not in order, but for RGBPanels it's not a problem, so you don't need this.

flasher69 commented 2 years ago

Haha! Yes, that was me too. The guy with a lot of issues! 🤣

I think I didn't clearly say what was my problem. I have four HUB75 64 x 64. I'm trying to modify the neomatrix_config.h file, so I can have the animation divided on all four panels but the animation is repeating on each panel and they all look the same. That's why I thought, that I need to change the matrix size. Unfortunately when I change the lines as you said, nothing works at all

2021-12-03 01 03 39

marcmerlin commented 2 years ago

Just to be clear, you want the framebuffer to be 128x128, and each panel contains 1/4th of the framebuffer, correct? If so, you first need to get that working with Smartmatrix itself (forget smartmatrix::gfx and neomatrix_config.h for now) with the featuredemo example I mentioned. The way it'll work is you need all 4 panels to be plugged daisy chained and you need to tell smartmatrix about your layout. That's in the smartmatrix docs somewhere or you can ask on the smartmatrix forum if you get stuck. Once that is working you should be able to copy the smartmatrix init inside neomatrix_config.h

flasher69 commented 2 years ago

Just to be clear, you want the framebuffer to be 128x128, and each panel contains 1/4th of the framebuffer, correct?

Exactly!

If so, you first need to get that working with Smartmatrix itself (forget smartmatrix::gfx and neomatrix_config.h for now) with the featuredemo example I mentioned. The way it'll work is you need all 4 panels to be plugged daisy chained and you need to tell smartmatrix about your layout. That's in the smartmatrix docs somewhere or you can ask on the smartmatrix forum if you get stuck. Once that is working you should be able to copy the smartmatrix init inside neomatrix_config.h

Oh! I see! Alright I will try that tomorrow when I had some sleep but at least I got that working with smartmatrix demo and Teensy 4/Smartmatrix Shield V5

Thank you so much for your help and sorry for all the annoying questions. I just want to understand how it all works :)

Cheers 2021-12-03 01 48 02

marcmerlin commented 2 years ago

No worries, how to do layout of matrices and mapping is not super obvious FastLED::NeoMatrix supports some weird remapping from using small LED panels and connecting them together. For RGBPanels, the layout and remapping is actually done by SmartMatrix. It's not much configurable, but for something simple like a 2x2 matrix, the defaults work just fine. Once you have the init working you should be able to copy it in framebuffer::gfx and it will write in it as if you had a big 128x128 display from a single panel