ESP32-HUB75-MatrixPanel-DMA icon indicating copy to clipboard operation
ESP32-HUB75-MatrixPanel-DMA copied to clipboard

P8 32x16

Open mjmokhtar opened this issue 1 year ago • 21 comments

https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA/assets/108962994/6c517300-fde4-405a-8790-3f2110867778

i have problem using p8 32x16, coordinate in matrix in not position `` else if (panel_scan_rate == FOUR_SCAN_16PX_HIGH) { if ((virt_y & 8) == 0) { coords.x += (panelResX >> 2) * (((coords.x & 0xFFF0) >> 4) + 1); // 1st, 3rd 'block' of 8 rows of pixels, offset by panel width in DMA buffer } else { coords.x += (panelResX >> 2) * (((coords.x & 0xFFF0) >> 4)); // 2nd, 4th 'block' of 8 rows of pixels, offset by panel width in DMA buffer }

    if (virt_y < 32)
        coords.y = (virt_y >> 4) * 8 + (virt_y & 0b00000111);
    else
    {
        coords.y = ((virt_y - 32) >> 4) * 8 + (virt_y & 0b00000111);
        coords.x += 256;
    }
}

``

I think this code from virtual matrix have issue for me I don't know how fix it
`` #include "ESP32-HUB75-MatrixPanel-I2S-DMA.h" #include "ESP32-VirtualMatrixPanel-I2S-DMA.h"

// Panel configuration #define PANEL_RES_X 32 // Number of pixels wide of each INDIVIDUAL panel module. #define PANEL_RES_Y 16 // Number of pixels tall of each INDIVIDUAL panel module.

#define NUM_ROWS 1 // Number of rows of chained INDIVIDUAL PANELS #define NUM_COLS 1 // Number of INDIVIDUAL PANELS per ROW

#define SERPENT true #define TOPDOWN false

// placeholder for the matrix object MatrixPanel_I2S_DMA *dma_display = nullptr;

// placeholder for the virtual display object VirtualMatrixPanel *FourScanPanel = nullptr;

void setup() { delay(250);

Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println("*         1/8 Scan Panel Demonstration              *");
Serial.println("*****************************************************");

HUB75_I2S_CFG mxconfig(
    PANEL_RES_X/2, // DO NOT CHANGE THIS
    PANEL_RES_Y/2, // DO NOT CHANGE THIS
    NUM_ROWS * NUM_COLS // DO NOT CHANGE THIS
);

mxconfig.clkphase = false; // Change this if you see pixels showing up shifted wrongly by one column the left or right.

//mxconfig.driver = HUB75_I2S_CFG::FM6126A; // in case that we use panels based on FM6126A chip, we can set it here before creating MatrixPanel_I2S_DMA object

// Create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);

// Adjust default brightness to about 75%
dma_display->setBrightness8(96); // range is 0-255, 0 - 0%, 255 - 100%

// Allocate memory and start DMA display
if (!dma_display->begin())
    Serial.println("****** !KABOOM! I2S memory allocation failed ***********");

dma_display->clearScreen();
delay(500);

// Create FourScanPanel object based on our newly created dma_display object
FourScanPanel = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y);

// THE IMPORTANT BIT BELOW!
FourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_32PX_HIGH);

}

void loop() { for (int y = 0; y < PANEL_RES_Y; y++) { // Loop through each row for (int x = 0; x < PANEL_RES_X; x++) { // Loop through each column FourScanPanel->drawPixel(x, y, FourScanPanel->color565(255, 255, 255)); // Light up one pixel Serial.print("Lighting pixel at ("); Serial.print(x); Serial.print(", "); Serial.print(y); Serial.println(")"); delay(100); // Delay to see the pixel lighting up FourScanPanel->drawPixel(x, y, FourScanPanel->color565(0, 0, 0)); // Turn off the pixel } } } `` hope this problem have solution

mjmokhtar avatar May 27 '24 04:05 mjmokhtar