Skip to content

80x40 P4 display pannel alignment problem #871

@rbensingh

Description

@rbensingh

I have an 80x40 P4 display with a chain of 6 in series panels, currently I have removed the 5 panels and testing using a single panel.
I have attached the code and the images. the results are not as expected, kindly guide me with it.

#include <Arduino.h>
#include <ESP32-HUB75-VirtualMatrixPanel_T.hpp>

#define PANEL_RES_X 80
#define PANEL_RES_Y 40
#define VDISP_NUM_ROWS 1
#define VDISP_NUM_COLS 1
#define PANEL_CHAIN_LEN (VDISP_NUM_ROWS * VDISP_NUM_COLS) // Don't change
#define PANEL_CHAIN_TYPE CHAIN_NONE
#define PANEL_SCAN_TYPE FOUR_SCAN_40_80PX_HFARCAN

MatrixPanel_I2S_DMA* dma_display = nullptr;
using MyScanTypeMapping = ScanTypeMapping<PANEL_SCAN_TYPE>;
VirtualMatrixPanel_T<PANEL_CHAIN_TYPE, MyScanTypeMapping>* virtualDisp = nullptr;

void setup() {
Serial.begin(115200);
delay(500);

HUB75_I2S_CFG::i2s_pins _pins = {
WF2_X1_R1_PIN, WF2_X1_G1_PIN, WF2_X1_B1_PIN,
WF2_X1_R2_PIN, WF2_X1_G2_PIN, WF2_X1_B2_PIN,
WF2_A_PIN, WF2_B_PIN, WF2_C_PIN, WF2_D_PIN, WF2_X1_E_PIN,
WF2_LAT_PIN, WF2_OE_PIN, WF2_CLK_PIN
};

HUB75_I2S_CFG mxconfig(
PANEL_RES_X * 2, // physical width encoding
PANEL_RES_Y / 2, // physical height encoding
PANEL_CHAIN_LEN, // panel chain length
_pins);

mxconfig.i2sspeed = HUB75_I2S_CFG::HZ_20M;
mxconfig.clkphase = true;
mxconfig.line_decoder = HUB75_I2S_CFG::SM5368;

dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(120);
dma_display->clearScreen();

virtualDisp = new VirtualMatrixPanel_T<PANEL_CHAIN_TYPE, MyScanTypeMapping>(
VDISP_NUM_ROWS, VDISP_NUM_COLS, PANEL_RES_X, PANEL_RES_Y);

virtualDisp->setDisplay(*dma_display);

for (int y = 0; y < virtualDisp->height(); y++) {
for (int x = 0; x < virtualDisp->width(); x++) {

  uint16_t color = virtualDisp->color565(96, 0, 0);  // red

  if (x == 0) color = virtualDisp->color565(0, 255, 0);                           // g
  if (x == (virtualDisp->width() - 1)) color = virtualDisp->color565(0, 0, 255);  // b

  virtualDisp->drawPixel(x, y, color);
  delay(1);
}

}

virtualDisp->drawLine(virtualDisp->width() - 1, virtualDisp->height() - 1, 0, 0, virtualDisp->color565(255, 255, 255));

virtualDisp->print("Virtual Matrix Panel");
delay(3000);
virtualDisp->clearScreen();
virtualDisp->drawDisplayTest(); // re draw text numbering on each screen to check connectivity
}

Thanks in advance.

Image
https://github.com/user-attachments/assets/267414f4-442b-400f-bb82-63f8c8fd4d0d
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions