Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 P5 32x64: Ghosting issues. #709

Open
NguyenMinhTri opened this issue Dec 18, 2024 · 1 comment
Open

2 P5 32x64: Ghosting issues. #709

NguyenMinhTri opened this issue Dec 18, 2024 · 1 comment
Labels
panel specific issue A HUB75 panel that isn't supported out-of-the-box. Fiddling required. Not a DMA library issue.

Comments

@NguyenMinhTri
Copy link

NguyenMinhTri commented Dec 18, 2024

z6145568649965_0335c33842a1d14123667a93cfab4c0d
Hello everyone, when I use the code below for two P5 32x64 LED panels, I encounter ghosting issues. Can anyone help me? I don't know what is causing it.
Thanks and best regards,
My Code
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>
#include <FastLED.h>

// GPIO Configuration
#define R1_PIN 25
#define G1_PIN 26

#define B1_PIN 27
#define R2_PIN 21
#define G2_PIN 22
#define B2_PIN 23
#define A_PIN 12
#define B_PIN 16
#define C_PIN 17
#define D_PIN 18
#define E_PIN -1
#define CLK_PIN 15
#define LAT_PIN 32
#define OE_PIN 33

// Matrix Configuration
#define MATRIX_WIDTH 128
#define MATRIX_HEIGHT 64

#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>

#define PANEL_RES_X 64
#define PANEL_RES_Y 32
#define NUM_ROWS 2
#define NUM_COLS 1
#define PANEL_CHAIN NUM_ROWS *NUM_COLS
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_LEFT_DOWN

MatrixPanel_I2S_DMA *dma_display = nullptr;
VirtualMatrixPanel virtualDisp = nullptr;
// Thêm biến buffer
uint16_t
screenBuffer = nullptr;

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

// Matrix Configuration
HUB75_I2S_CFG mxconfig(PANEL_RES_X, PANEL_RES_Y, PANEL_CHAIN);
mxconfig.gpio.r1 = R1_PIN;
mxconfig.gpio.g1 = G1_PIN;
mxconfig.gpio.b1 = B1_PIN;
mxconfig.gpio.r2 = R2_PIN;
mxconfig.gpio.g2 = G2_PIN;
mxconfig.gpio.b2 = B2_PIN;
mxconfig.gpio.a = A_PIN;
mxconfig.gpio.b = B_PIN;
mxconfig.gpio.c = C_PIN;
mxconfig.gpio.d = D_PIN;
mxconfig.gpio.e = E_PIN;
mxconfig.gpio.clk = CLK_PIN;
mxconfig.gpio.lat = LAT_PIN;
mxconfig.gpio.oe = OE_PIN;
mxconfig.i2sspeed = HUB75_I2S_CFG::HZ_20M;

dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->setBrightness8(128);

if (!dma_display->begin()) {
Serial.println("I2S memory allocation failed!");
return;
}

virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
drawStaticContent();
}

void loop() {

}

void drawStaticContent() {
int centerX = virtualDisp->width() / 2;
int centerY = virtualDisp->height() / 2;

int colorGreen = virtualDisp->color565(0, 255, 0); // Màu xanh lá cây tươi
int colorWhite = virtualDisp->color565(255, 255, 255); // Màu trắng

virtualDisp->fillScreen(0); // Xóa màn hình một lần duy nhất

virtualDisp->setTextColor(colorWhite);
virtualDisp->setTextSize(3);
virtualDisp->setCursor(centerX - 18, centerY - 10); // Căn chỉnh chữ giữa màn hình
virtualDisp->print("OM");
}
z6142725898816_f73848ad4190b6779173c2288bfccd44
z6142725868353_df8010fe2f12d539d5dc40be619b4dd3
z6142725899171_012a6470471def19eff937d3db2fbf9f

@NguyenMinhTri NguyenMinhTri changed the title Panel 2: Ghosting issues 2 P5 32x64: Ghosting issues. Dec 19, 2024
@mrcodetastic
Copy link
Owner

Does changing the clkphase value help? Or reduce the clock frequency?

@mrcodetastic mrcodetastic added the panel specific issue A HUB75 panel that isn't supported out-of-the-box. Fiddling required. Not a DMA library issue. label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
panel specific issue A HUB75 panel that isn't supported out-of-the-box. Fiddling required. Not a DMA library issue.
Projects
None yet
Development

No branches or pull requests

2 participants