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

How to connect multiple Led panel #356

Open
tientruong611 opened this issue Jan 11, 2025 · 1 comment
Open

How to connect multiple Led panel #356

tientruong611 opened this issue Jan 11, 2025 · 1 comment

Comments

@tientruong611
Copy link

I have a problem with led panel , as instruction we connect PI with PO at 1 label , but if we have 2 panel we have to connect PO at panel 1 to PI panel 2 , so where can i connect 5 wires R2 G1 G2 B1 B2 of led panel 1

PI | PO

R2 | R1
G1 | R2
G2 | G1
B1 | G2
B2 | B1

image

@tientruong611
Copy link
Author

i fix that , we have to connect PO of led panel 1 to led panel 2 and 5 wires connect with PO of led panel 2. but i have a new problem with flick on my panel how can i fix that , this is my code
#include <PxMatrix.h>
#include <Ticker.h>
Ticker display_ticker;
#define P_LAT 22
#define P_A 19
#define P_B 23
#define P_C 18
#define P_D 5
#define P_OE 16
hw_timer_t * timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
#define matrix_width 128
#define matrix_height 32
uint8_t display_draw_time=10; //30-70 is usually fine

PxMATRIX display(matrix_width, matrix_height, P_LAT, P_OE, P_A, P_B, P_C, P_D);

// Some standard colors
uint16_t myRED = display.color565(255, 0, 0);
uint16_t myGREEN = display.color565(0, 255, 0);
uint16_t myBLUE = display.color565(0, 0, 255);
uint16_t myWHITE = display.color565(255, 255, 255);
uint16_t myYELLOW = display.color565(255, 255, 0);
uint16_t myCYAN = display.color565(0, 255, 255);
uint16_t myMAGENTA = display.color565(255, 0, 255);
uint16_t myBLACK = display.color565(0, 0, 0);

#ifdef ESP32
void IRAM_ATTR display_updater(){
// Increment the counter and set the time of ISR
portENTER_CRITICAL_ISR(&timerMux);
display.display(display_draw_time);
portEXIT_CRITICAL_ISR(&timerMux);
}
#endif

void display_update_enable(bool is_enable)
{

#ifdef ESP32
if (is_enable)
{
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &display_updater, true);
timerAlarmWrite(timer, 4000, true);
timerAlarmEnable(timer);
}
else
{
timerDetachInterrupt(timer);
timerAlarmDisable(timer);
}
#endif
}
void setup() {
Serial.begin(9600);
display.begin(16);
display.setPanelsWidth(2);
display.clearDisplay();
display.setTextColor(myCYAN);
display.setCursor(2,0);
display.print("Pixel");
display.setTextColor(myMAGENTA);
display.setCursor(2,8);
display.print("Time");
display_update_enable(true);

delay(3000);
}

//void scroll_text(uint8_t ypos, unsigned long scroll_delay, String text, uint8_t colorR, uint8_t colorG, uint8_t colorB) {
// uint16_t text_length = text.length();
// display.setTextWrap(false);
// display.setTextSize(1);
// display.setRotation(0);
// display.setTextColor(display.color565(colorR, colorG, colorB));
//
// for (int xpos = matrix_width; xpos > -(matrix_width + text_length * 5); xpos--) {
// display.clearDisplay();
// display.setCursor(xpos, ypos);
// display.println(text);
// delay(scroll_delay);
// yield();
// }
//}

void display_text(uint8_t ypos,uint8_t xpos, String text, uint8_t colorR, uint8_t colorG, uint8_t colorB) {
uint16_t text_length = text.length();
display.setTextWrap(false);
display.setTextSize(1);
display.setRotation(0);
display.setTextColor(display.color565(colorR, colorG, colorB));
display.clearDisplay();
display.setCursor(xpos, ypos);
display.println(text);
yield();

}

void loop() {
// scroll_text(9, 50, "Welcome to PxMatrix!", 96, 96, 250);
display_text(9,3, "123456789", 96, 96, 250);
// delay(2000);
delay(2000); // Giữ màn hình đỏ trong 2 giây
display.setBrightness(255); // Tăng độ sáng lên mức tối đa
// display.fillScreen(display.color565(0, 255, 0)); // Màu xanh lá
delay(2000); // Giữ màn hình xanh trong 2 giây
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant