Skip to content

P10-RGB-LED 64 x 48 #364

Description

@hobbykits4u

Hi All
Want some Guidance to make big size Display Using P10 RGB LED Module, Its Total 6 Modules (32 x 16 each) with ESP32
its 64 x 48 Pixel display.
How to configured or connection for Multiple Modules ?

Will try single module its work perfectly. here my tested code, will try to change

#define matrix_width 64
#define matrix_height 48

but its not working.


// You can use the values ​​20000000, 15000000, 10000000 and 8000000. Or you can also try using other values.
#define PxMATRIX_SPI_FREQUENCY 10000000

// Creates a second buffer for backround drawing (doubles the required RAM).
//#define PxMATRIX_double_buffer true

//----------------------------------------Including Libraries.
#include <PxMatrix.h>
#include <Fonts/NavineDemo_HK4u_Number_7pt7b.h>
#include <Fonts/NavineDemo_SemiCondensed_7pt7b.h>
// For Font Modification >> https://tchapi.github.io/Adafruit-GFX-Font-Customiser/
// To Genrate NEW GFX Font >> https://rop.nl/truetype2gfx/

//----------------------------------------

//----------------------------------------Pins for LED MATRIX.
#define P_LAT 5
#define P_A 19
#define P_B 23
#define P_C 18
#define P_OE 4
//----------------------------------------

// Defines the width and height of the panel in pixels.
//#define matrix_width 32
//#define matrix_height 16

#define matrix_width 96
#define matrix_height 16

// Timer setup.
// Create a hardware timer of ESP32.
hw_timer_t * timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;

// This defines the 'on' time of the display is us.
// The larger this number, the brighter the display. If too large the ESP will crash.
uint8_t display_draw_time = 30; // 30-70 is usually fine.

// Declaring the "PxMATRIX" object as a "display" and its settings.
PxMATRIX display(matrix_width, matrix_height, P_LAT, P_OE, P_A, P_B, P_C);

//----------------------------------------Variable for some colors.
// display.color565(R value = 0-255, G value = 0-255, B value = 0-255);
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 myYELLOW = display.color565(255, 255, 0);
uint16_t myCYAN = display.color565(0, 255, 255);
uint16_t myFUCHSIA = display.color565(255, 0, 255);
uint16_t myBLACK = display.color565(0, 0, 0);
uint16_t myWHITE = display.color565(255, 255, 255);

uint16_t myCOLOR_ARRAY[4] = {myRED, myGREEN, myBLUE, myWHITE};
//----------------------------------------

//________________________________________________________________________________ IRAM_ATTR display_updater()
// Interrupt handler for Timer.
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);
}
//________________________________________________________________________________

//________________________________________________________________________________ display_update_enable()
// Subroutine to enable and disable interrupt timers.
void display_update_enable(bool is_enable) {
if (is_enable){
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &display_updater, true);
timerAlarmWrite(timer, 1500, true);
timerAlarmEnable(timer);
}
else{
timerDetachInterrupt(timer);
timerAlarmDisable(timer);
}
}
//________________________________________________________________________________

//________________________________________________________________________________ VOID SETUP()
void setup() {
// put your setup code here, to run once:

delay(2000);
Serial.begin(115200);
Serial.println();

// Display initialization.
display.begin(8); //--> Value 8 for 1/8 row scan panel.
delay(100);

// Enable Timer Interrupts.
display_update_enable(true);
delay(100);

display.clearDisplay();
delay(1000);

display.setBrightness(125); //--> Range from 0 to 255.
delay(100);

display.fillScreen(myRED);
delay(100);
display.fillScreen(myGREEN);
delay(100);
display.fillScreen(myBLUE);
delay(100);
display.fillScreen(myWHITE);
delay(100);

display.clearDisplay();
delay(1000);

display.setTextWrap(false);
display.setTextSize(1);
display.setRotation(0);
delay(100);

//display.fillScreen(display.color565(255, 0, 0));
display.clearDisplay();
display.setTextColor(display.color565(255, 255, 255));
display.setCursor(0, 0);
display.print("ATUL");
display.setTextColor(display.color565(255, 255, 255));
display.setCursor(0, 9);
display.print("SAVLA");
delay(1000);

display.clearDisplay();
delay(100);
}
//________________________________________________________________________________

//________________________________________________________________________________ VOID LOOP()
void loop() {
// put your main code here, to run repeatedly:

int myCOLOR_ARRAY_Length = sizeof(myCOLOR_ARRAY) / sizeof(myCOLOR_ARRAY[0]);

for (byte i = 0; i < myCOLOR_ARRAY_Length; i++) {
display.setTextColor(myCOLOR_ARRAY[i]);
display.setFont(&NavineDemo_HK4u_Number_7pt7b);
//display.setFont(&NavineDemo_SemiCondensed_7pt7b);
//display.setTextSize(1);
display.setCursor(1, 11);
display.print("67:89");
//display.setCursor(0, 9);
//display.print("ABCD");
delay(2500);

//display.clearDisplay();
//delay(1000);

/*
display.setTextColor(myCOLOR_ARRAY[i]);
display.setCursor(4, 0);
display.print("1234");
display.setCursor(4, 9);
display.print("ABCD");
delay(2500);

display.clearDisplay();
delay(1000);

display.setCursor(9, 0);
display.print("1234");
display.setCursor(9, 9);
display.print("ABCD");
delay(2500);

*/
// display.clearDisplay();
// delay(1000);
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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