Open mjmokhtar opened 11 months ago
this panel using DP5125D please help me mr mrfaptastic
Can you test with another library as well? Like PxMatrix library.
If you have same issues then you have defective panel.
You can easily workaround the red/green issue by just swapping the pins around in the config.
actually, when I use 64x64 px, the panel can display not cutting like my video. I've using PxMatrix and it's same and I've read documentation of PxMatrix, that's library just for one panel
so i've don't know what I should I do for this think
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/516
its same like this
If the label "32scan" is not a mistake, it is something completely new among the HUB75 panels. All the panels I had to deal with had a scan factor of no more than half the height. That is, for a 64x32 matrix, the scan should be 16 or less. Your matrix is some new type and I don’t know any libraries that support such panels.
for your information mr my panel have led driver IC DP5125D
i tried to find datasheet but I didn't found it
once again when I use 64x64 px, the panel can display not cutting like my video https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/516
its same like this
when i change panel Y from 32 to 64 display not cutting but it will be cutting when I define Panel Y become 32
i've try scan cordinate using this code
`#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
//**** Display Config Declaration
MatrixPanel_I2S_DMA* dma_display = nullptr;
uint16_t myBLACK; uint16_t myWHITE; uint16_t myRED; uint16_t myGREEN; uint16_t myBLUE;
void setup() { Serial.begin(115200);
// Configurations for Display HUB75_I2S_CFG mxconfig( PANEL_RES_X, // module width PANEL_RES_Y, // module height PANEL_CHAIN // Chain length );
mxconfig.double_buff = true; mxconfig.gpio.e = 32; mxconfig.clkphase = false;
// Display Setup dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); dma_display->setBrightness8(255); //0-255
// Define colors myBLACK = dma_display->color565(0, 0, 0); myWHITE = dma_display->color565(255, 255, 255); myRED = dma_display->color565(255, 0, 0); myGREEN = dma_display->color565(0, 255, 0); myBLUE = dma_display->color565(0, 0, 255);
// Print dot at each coordinate for (int y = 0; y < PANEL_RES_Y; y++) { for (int x = 0; x < PANEL_RES_X * PANEL_CHAIN; x++) { dma_display->drawPixel(x, y, myRED); // Print coordinates Serial.print("("); Serial.print(x); Serial.print(","); Serial.print(y); Serial.print(") "); delay(100); // Delay 500ms before printing the next dot } Serial.println(); // Move to the next line after each row } }
void loop() { // Nothing here, just printing dots in setup() } ` here's debug
here's in visual led matrix
for red color I can fix it but for coordinate i need help thanks
is sombody can help me i still stuck
I am in doubt that anybody can help without having the panel for tests. How many such panels do you have? Perhaps buying a different model could be a solution?
@board707 actualy i just wonder how to fix this code by my self but I still stuck , i can't buying for solution because it new feature led but still no code cant explain this what this happen
i need help Mr @board707
if you don't mine i will send my email to you, and we can solve it together if you don't mind
Unfortunately, I do not use ESP32 with HUB75 RGB matrices. If you don’t have to use ESP32, we can try your panel with boards based on Pico RP2040 or STM32 controllers.
i found another condition my HUB75 have pin a,b,c,d and pin E in another hub75 they don't have pin E
so I tried to measure the voltage in pin E there is no signal, different from the another pin a,b,c, and d have voltage 1.12v a data
I hope this data can we figure it out together
my HUB75 have pin a,b,c,d and pin E in another hub75 they don't have pin E
There is no magic in it. It depends only on number of scan lines. Panels with 16 scans and less doesn't need a E line. Panels with 8scans and less doesn't need a D and E lines... and so on
i have told you before my hub is different and i know but my p4 led panel matrix needs pin e, cause it has 32 scans you can say that not magic
I really need help for this, what I would do for this
my p4 led panel
"P4" says nothing about panel type, please be more specific and use informative labels - for example "64x32 s32 panel". And "p4" is completely unnecessary for it :)
my hub is different
There is no difference in the fact that your HUB has E pin. This is common to all 32s panels
what I would do for this
Did you try to configure the library as for 64x64 panel ?
yes i have it this panel will full https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/issues/516 same like this
516
its same like this
So the panel works? What is your problem?
not work for 64x32 it cut my content display when it parallel that why I ask how can be to solve this for multi panel
not work for 64x32
Please understand that technically your panel is not a 64x32, it is a half of 64x64 panel. So you have to setup and use it as 64x64. Do not try to setup it as 64x32 - nothing will come of this. If you need a several panels, chained horizontally, you can setup it as chain of 64x64 panels - it should work. If you need a several horizontal rows of panels - the setup is slightly different. You need to connect R0 G0 B0 lines to corresponding pins of upper row of panels, and R1 G1 B1 lines to R0 G0 B0 pins of lower row
yes that why i ask how to try it 64x32 because when I want to print something that cut even I use 64x64 and been chain panel it cause set 64x64 my panel thing is one panel not chain panel
you said about R0G0B0 can you tell me how to set up that ?
that why i ask how to try it 64x32
as 64x32 no way. use it as 64x64
even I use 64x64 and been chain panel it cause set 64x64 my panel thing is one panel not chain panel
I don't understand... Do you use a google translate?
yes i use translator app i know its not helping but I just share my problem I still want use 64x32 code and I try figure it out to found it
event you said 64x64 code, I think there is way to use 64x32 panel without problem and that solution is change library code that's why I ask
thank you
I think there is way to use 64x32 panel without problem and that solution is change library code that's why I ask
Do you expect that somebody will redesign the library for you? - as I said before, for this one at least need to have such a panel. More realistic if you would try to edit the code yourself and then offer a PR with your changes.
However, the simplest thing is to use the panel as 64x64, as I described above. This does not require editing the library
hi mr @board707 i am sorry for my bad explanation about this panel here is my problem
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
//************************************************************ Display Config Declaration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN 1 // Total number of panels chained one to another
MatrixPanel_I2S_DMA* dma_display = nullptr;
uint16_t myBLACK;
uint16_t myWHITE;
uint16_t myRED;
uint16_t myGREEN;
uint16_t myBLUE;
void setup() {
Serial.begin(115200);
// Configurations for Display
HUB75_I2S_CFG mxconfig(
PANEL_RES_X, // module width
PANEL_RES_Y, // module height
PANEL_CHAIN // Chain length
);
mxconfig.double_buff = true;
mxconfig.gpio.e = 32;
mxconfig.clkphase = false;
// Display Setup
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(255); //0-255
// Define colors
myBLACK = dma_display->color565(0, 0, 0);
myWHITE = dma_display->color565(255, 255, 255);
myRED = dma_display->color565(255, 0, 0);
myGREEN = dma_display->color565(0, 255, 0);
myBLUE = dma_display->color565(0, 0, 255);
// Print dot at each coordinate
for (int y = 0; y < PANEL_RES_Y; y++) {
for (int x = 0; x < PANEL_RES_X * PANEL_CHAIN; x++) {
dma_display->drawPixel(x, y, myRED);
// Print coordinates
Serial.print("(");
Serial.print(x);
Serial.print(",");
Serial.print(y);
Serial.print(") ");
delay(100); // Delay 500ms before printing the next dot
}
Serial.println(); // Move to the next line after each row
}
}
void loop() {
// Nothing here, just printing dots in setup()
}
I've used this code for debugging this panel when it reaches half of the coordinate height (32/2 = 16) he is displaced to the left even though I actually only used 1 panel, I didn't plan to make 2 panels and there should be duplicates on both sides
but when i change panel y become times 2 (32*2 =64)
PANEL_RES_Y*2, // DO NOT CHANGE THIS
why i use this condition, is because when i use this he be come full dot in this display
i think i should make virtual matrix code for this panel so pixel not cutting in middle
like this
/* ================================================== */
// Panel configuration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // 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
// ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
// Change this to your needs, for details on VirtualPanel pls read the PDF!
#define SERPENT true
#define TOPDOWN false
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_RIGHT_DOWN
// placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// placeholder for the virtual display object
EightPxBasePanel *FourScanPanel = nullptr;
/******************************************************************************
Setup!
******************************************************************************/
void setup()
{
delay(250);
Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println("* 1/32 Scan Panel Demonstration *");
Serial.println("*****************************************************");
/*
// 62x32 1/8 Scan Panels don't have a D and E pin!
HUB75_I2S_CFG::i2s_pins _pins = {
R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN,
A_PIN, B_PIN, C_PIN, D_PIN, E_PIN,
LAT_PIN, OE_PIN, CLK_PIN
};
*/
HUB75_I2S_CFG mxconfig(
PANEL_RES_X, // DO NOT CHANGE THIS
PANEL_RES_Y*2, // DO NOT CHANGE THIS
NUM_ROWS * NUM_COLS // DO NOT CHANGE THIS
//,_pins // Uncomment to enable custom pins
);
but when i saw this code below last time i still didn't know how to start fixing it
/* Use a custom Virtual Display class to re-map co-ordinates such that they draw
correctly on a 32x16 1/4 Scan panel (or chain of such panels).
*/
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
/* ================================================== */
// Define custom class derived from VirtualMatrixPanel
class EightPxBasePanel : public VirtualMatrixPanel
{
public:
using VirtualMatrixPanel::VirtualMatrixPanel; // inherit VirtualMatrixPanel's constructor(s)
protected:
VirtualCoords getCoords(int16_t x, int16_t y); // custom getCoords() method for specific pixel mapping
};
inline VirtualCoords EightPxBasePanel ::getCoords(int16_t x, int16_t y) {
coords = VirtualMatrixPanel::getCoords(x, y); // first call base class method to update coords for chaining approach
if ( coords.x == -1 || coords.y == -1 ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range!
return coords;
}
const uint8_t pxbase =8;
if (((coords.y / 5)%2) == 0)
{
coords.x = (coords.x / pxbase)*2*pxbase + 7 - (coords.x & 0x7);
}
else
{
coords.x += ((coords.x / pxbase) + 1) * pxbase;
}
coords.y = (coords.y / 10) * 5 + (coords.y % 5);
return coords;
}
i need your help how to coordinate this panel thanks
Could you test this code with two 64x32 panels chained and show the video?
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
//************************************************************ Display Config Declaration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN 2 // Total number of panels chained one to another
MatrixPanel_I2S_DMA* dma_display = nullptr;
uint16_t myBLACK;
uint16_t myWHITE;
uint16_t myRED;
uint16_t myGREEN;
uint16_t myBLUE;
void setup() {
Serial.begin(115200);
// Configurations for Display
HUB75_I2S_CFG mxconfig(
PANEL_RES_X, // module width
PANEL_RES_Y, // module height
PANEL_CHAIN // Chain length
);
mxconfig.double_buff = true;
mxconfig.gpio.e = 32;
mxconfig.clkphase = false;
// Display Setup
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(255); //0-255
// Define colors
myBLACK = dma_display->color565(0, 0, 0);
myWHITE = dma_display->color565(255, 255, 255);
myRED = dma_display->color565(255, 0, 0);
myGREEN = dma_display->color565(0, 255, 0);
myBLUE = dma_display->color565(0, 0, 255);
// Print dot at each coordinate
for (int y = 0; y < PANEL_RES_Y; y++) {
for (int x = 0; x < PANEL_RES_X * PANEL_CHAIN; x++) {
dma_display->drawPixel(x, y, myRED);
delay(30); // Delay 500ms before printing the next dot
}
Serial.println(); // Move to the next line after each row
}
}
void loop() {
// Nothing here, just printing dots in setup()
}
here is video
something happens when the left panel should display pixels but none appear instead the one on the right appears When the pixel display should be displayed at the bottom right, it instead appears at the top left i don't know, When we want to display red, what appears instead is a green pixel maybe need to set the initial value for red
Thank you
When we want to display red, what appears instead is a green pixel
Perhaps the panel just has a color channels mixed? Did you test what the output of the red, gree, blue?
When the pixel display should be displayed at the bottom right, it instead appears at the top left i don't know,
Thank you, but I still don't understand, how it works.
Have you ever worked with STM32 or RP2040 arduino boards?
I've tried changing colors When I want green, blue appears instead When I want blue, red appears instead
#define R1_PIN_DEFAULT 25
#define G1_PIN_DEFAULT 26
#define B1_PIN_DEFAULT 27
#define R2_PIN_DEFAULT 14
#define G2_PIN_DEFAULT 12
#define B2_PIN_DEFAULT 13
#define A_PIN_DEFAULT 23
#define B_PIN_DEFAULT 22
#define C_PIN_DEFAULT 5
#define D_PIN_DEFAULT 19
#define E_PIN_DEFAULT 32 // IMPORTANT: Change to a valid pin if using a 64x64px panel. 32
#define LAT_PIN_DEFAULT 21
#define OE_PIN_DEFAULT 33
#define CLK_PIN_DEFAULT 18
I used this pin and PIN E need request because when E still -1 that panel doesn't work
my senior use stm32 and he give me some code like this
#if MATRIX_SCANROW==MATRIX_SCANROWS_32
row = y;
// lines = x;
if (x < MATRIX_PANEL_WIDTH)
{
lines = x;
}
else if (x < (MATRIX_PANEL_WIDTH * 2))
{
lines = (x % MATRIX_PANEL_WIDTH) + MATRIX_PANEL_WIDTH;
busNumber = 1;
}
else
{
lines = (x % MATRIX_PANEL_WIDTH) + MATRIX_PANEL_WIDTH;
}
#endif //if MATRIX_SCANROW==MATRIX_SCANROWS_32
he said we need virtual matrix for this condition and color condition change from 0b001 to 0b100 (I still didn't get it from this initial)
When I want green, blue appears instead When I want blue, red appears instead
So your panels has a different color order, like GBR instead of RGB. It all.
he said we need virtual matrix for this condition
This problem cannot be solved by virtual matrix alone. Virtual matrix can't resolve the pin E problem. How many panels do you have?
currently, i have 3 panels right now
I just add one panel and just change color become blue
result same like last video
currently, i have 3 panels right now video4.mp4
I just add one panel and just change color become blue
I think we need a virtual matrix with virtual half width and double height
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
//,_pins // Uncomment to enable custom pins
);
and use coordinates transform something like this:
if ( coords.x & 64) {
coords.x -= 64;
coords.y +=32;
}
I'm sorry, I've try 3 times, the code doesn't display anything just blank
here I write code for virtual matrix which you have suggested
/* Use a custom Virtual Display class to re-map co-ordinates such that they draw
correctly on a 32x16 1/4 Scan panel (or chain of such panels).
*/
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
/* ================================================== */
// Define custom class derived from VirtualMatrixPanel
class EightPxBasePanel : public VirtualMatrixPanel
{
public:
using VirtualMatrixPanel::VirtualMatrixPanel; // inherit VirtualMatrixPanel's constructor(s)
protected:
VirtualCoords getCoords(int16_t x, int16_t y); // custom getCoords() method for specific pixel mapping
};
inline VirtualCoords EightPxBasePanel ::getCoords(int16_t x, int16_t y) {
coords = VirtualMatrixPanel::getCoords(x, y); // first call base class method to update coords for chaining approach
if ( coords.x == -1 || coords.y == -1 ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range!
return coords;
}
if ( coords.x & 64) {
coords.x -= 64;
coords.y +=32;
}
}
/* ================================================== */
// Panel configuration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // 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
// ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
// Change this to your needs, for details on VirtualPanel pls read the PDF!
#define SERPENT true
#define TOPDOWN false
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_RIGHT_DOWN
// placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// placeholder for the virtual display object
EightPxBasePanel *FourScanPanel = nullptr;
/******************************************************************************
Setup!
******************************************************************************/
void setup()
{
delay(250);
Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println("* 1/32 Scan Panel Demonstration *");
Serial.println("*****************************************************");
/*
// 62x32 1/8 Scan Panels don't have a D and E pin!
HUB75_I2S_CFG::i2s_pins _pins = {
R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN,
A_PIN, B_PIN, C_PIN, D_PIN, E_PIN,
LAT_PIN, OE_PIN, CLK_PIN
};
*/
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
//,_pins // Uncomment to enable custom pins
);
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
// OK, now we can create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
// let's adjust default brightness to about 75%
dma_display->setBrightness8(255); // range is 0-255, 0 - 0%, 255 - 100%
// Allocate memory and start DMA display
if ( not dma_display->begin() )
Serial.println("****** !KABOOM! I2S memory allocation failed ***********");
dma_display->clearScreen();
delay(500);
// create FourScanPanellay object based on our newly created dma_display object
FourScanPanel = new EightPxBasePanel ((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
// THE IMPORTANT BIT BELOW!
// FOUR_SCAN_16PX_HIGH
// FOUR_SCAN_32PX_HIGH
// **** You don't need to set PhysicalPanelScanRate when use your own virtual panel class
//FourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_16PX_HIGH);
}
// Test the pixel mapping - fill the panel pixel by pixel
void loop() {
for (int i = 0; i < FourScanPanel->height(); i++)
{
for (int j = 0; j < FourScanPanel->width(); j++)
{
FourScanPanel->drawPixel(j, i, FourScanPanel->color565(255, 0, 0));
delay(30);
}
}
delay(2000);
dma_display->clearScreen();
} // end loop
hi @board707 I am so sorry to disturb you, any suggestions what should I do now?
I don't see anything incorrect in your code. Try to change this:
HUB75_I2S_CFG mxconfig(
PANEL_RES_X , // DO NOT CHANGE THIS
PANEL_RES_Y*2, // DO NOT CHANGE THIS
NUM_ROWS * NUM_COLS // DO NOT CHANGE THIS
//,_pins // Uncomment to enable custom pins
);
I've tried it and the dot matrix doesn't appear, even by changing the color it doesn't appear
Could you test again your code that produce a video2 from this message https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA/issues/540#issuecomment-2149701599 ? If it still works, please show that code in full.
actualy i never using that code i just using
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
//************************************************************ Display Config Declaration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
#define PANEL_CHAIN 1 // Total number of panels chained one to another
MatrixPanel_I2S_DMA* dma_display = nullptr;
uint16_t myBLACK;
uint16_t myWHITE;
uint16_t myRED;
uint16_t myGREEN;
uint16_t myBLUE;
void setup() {
Serial.begin(115200);
// Configurations for Display
HUB75_I2S_CFG mxconfig(
PANEL_RES_X, // module width
PANEL_RES_Y, // module height
PANEL_CHAIN // Chain length
);
mxconfig.double_buff = true;
mxconfig.gpio.e = 32;
mxconfig.clkphase = false;
// Display Setup
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(255); //0-255
// Define colors
myBLACK = dma_display->color565(0, 0, 0);
myWHITE = dma_display->color565(255, 255, 255);
myRED = dma_display->color565(255, 0, 0);
myGREEN = dma_display->color565(0, 255, 0);
myBLUE = dma_display->color565(0, 0, 255);
// Print dot at each coordinate
for (int y = 0; y < PANEL_RES_Y; y++) {
for (int x = 0; x < PANEL_RES_X * PANEL_CHAIN; x++) {
dma_display->drawPixel(x, y, myRED);
// Print coordinates
Serial.print("(");
Serial.print(x);
Serial.print(",");
Serial.print(y);
Serial.print(") ");
delay(100); // Delay 500ms before printing the next dot
}
Serial.println(); // Move to the next line after each row
}
}
void loop() {
// Nothing here, just printing dots in setup()
}
I meant your comment below:
when i change panel y become times 2 (32*2 =64)
PANEL_RES_Y*2, // DO NOT CHANGE THIS
when i use this he be come full dot in this display
And as illustration to it you shown a video2.mp4
file where the first panel fulfilled completely.
actually that is just my suggestion to change that but I haven't done it yet
video2.mp4 is when panel_res_y = 64
//**** Display Config Declaration
define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
define PANEL_CHAIN 1 // Total number of panels chained one to another
I don't understand why it is nothing on the panel. Perhaps it might not work correctly - but at least a few leds should be on. Please test again tour connections.
If the problem is not with the connections, then I don't know how else to help you.
Where are you from?
i from indonesia
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
/* Use a custom Virtual Display class to re-map co-ordinates such that they draw
correctly on a 32x16 1/4 Scan panel (or chain of such panels).
*/
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
/* ================================================== */
// Define custom class derived from VirtualMatrixPanel
class EightPxBasePanel : public VirtualMatrixPanel
{
public:
using VirtualMatrixPanel::VirtualMatrixPanel; // inherit VirtualMatrixPanel's constructor(s)
protected:
VirtualCoords getCoords(int16_t x, int16_t y); // custom getCoords() method for specific pixel mapping
};
inline VirtualCoords EightPxBasePanel ::getCoords(int16_t x, int16_t y) {
coords = VirtualMatrixPanel::getCoords(x, y); // first call base class method to update coords for chaining approach
if ( coords.x == -1 || coords.y == -1 ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range!
return coords;
}
if ( coords.x & 64) {
coords.x -= 64;
coords.y +=32;
}
}
/* ================================================== */
// Panel configuration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // 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
// ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
// Change this to your needs, for details on VirtualPanel pls read the PDF!
#define SERPENT true
#define TOPDOWN false
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_RIGHT_DOWN
// placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// placeholder for the virtual display object
EightPxBasePanel *FourScanPanel = nullptr;
/******************************************************************************
Setup!
******************************************************************************/
void setup()
{
delay(250);
Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println("* 1/32 Scan Panel Demonstration *");
Serial.println("*****************************************************");
/*
// 62x32 1/8 Scan Panels don't have a D and E pin!
HUB75_I2S_CFG::i2s_pins _pins = {
R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN,
A_PIN, B_PIN, C_PIN, D_PIN, E_PIN,
LAT_PIN, OE_PIN, CLK_PIN
};
*/
HUB75_I2S_CFG mxconfig(
PANEL_RES_X , // DO NOT CHANGE THIS
PANEL_RES_Y * 2, // DO NOT CHANGE THIS
NUM_ROWS * NUM_COLS // DO NOT CHANGE THIS
//,_pins // Uncomment to enable custom pins
);
mxconfig.clkphase = false; // Change this if you see pixels showing up shifted wrongly by one column the left or right.
mxconfig.gpio.e = 32;
//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
// OK, now we can create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
// let's adjust default brightness to about 75%
dma_display->setBrightness8(255); // range is 0-255, 0 - 0%, 255 - 100%
// Allocate memory and start DMA display
if ( not dma_display->begin() )
Serial.println("****** !KABOOM! I2S memory allocation failed ***********");
dma_display->clearScreen();
delay(500);
// create FourScanPanellay object based on our newly created dma_display object
FourScanPanel = new EightPxBasePanel ((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
// THE IMPORTANT BIT BELOW!
// FOUR_SCAN_16PX_HIGH
// FOUR_SCAN_32PX_HIGH
// **** You don't need to set PhysicalPanelScanRate when use your own virtual panel class
//FourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_16PX_HIGH);
}
// Test the pixel mapping - fill the panel pixel by pixel
void loop() {
for (int i = 0; i < FourScanPanel->height(); i++)
{
for (int j = 0; j < FourScanPanel->width(); j++)
{
FourScanPanel->drawPixel(j, i, FourScanPanel->color565(255, 255, 255));
// Print coordinates
Serial.print("(");
Serial.print(j);
Serial.print(",");
Serial.print(i);
Serial.print(") ");
delay(30);
}
}
delay(2000);
dma_display->clearScreen();
} // end loop
please read my code is something wrong ?
actually when I try using
/******************************************************************************
-------------------------------------------------------------------------
Steps to create a virtual display made up of a chain of panels in a grid
-------------------------------------------------------------------------
Read the documentation!
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/tree/master/examples/ChainedPanels
tl/dr:
- Set values for NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, PANEL_CHAIN_TYPE.
- Other than where the matrix is defined and matrix.begin in the setup, you
should now be using the virtual display for everything (drawing pixels, writing text etc).
You can do a find and replace of all calls if it's an existing sketch
(just make sure you don't replace the definition and the matrix.begin)
- If the sketch makes use of MATRIX_HEIGHT or MATRIX_WIDTH, these will need to be
replaced with the width and height of your virtual screen.
Either make new defines and use that, or you can use virtualDisp.width() or .height()
*****************************************************************************/
// 1) Include key virtual display library
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
// 2) Set configuration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
#define NUM_ROWS 1 // Number of rows of chained INDIVIDUAL PANELS
#define NUM_COLS 2 // Number of INDIVIDUAL PANELS per ROW
#define PANEL_CHAIN NUM_ROWS*NUM_COLS // total number of panels chained one to another
/* Configure the serpetine chaining approach. Options are:
CHAIN_TOP_LEFT_DOWN
CHAIN_TOP_RIGHT_DOWN
CHAIN_BOTTOM_LEFT_UP
CHAIN_BOTTOM_RIGHT_UP
The location (i.e. 'TOP_LEFT', 'BOTTOM_RIGHT') etc. refers to the starting point where
the ESP32 is located, and how the chain of panels will 'roll out' from there.
In this example we're using 'CHAIN_BOTTOM_LEFT_UP' which would look like this in the real world:
Chain of 4 x 64x32 panels with the ESP at the BOTTOM_LEFT:
+---------+---------+
| 4 | 3 |
| | |
+---------+---------+
| 1 | 2 |
| (ESP) | |
+---------+---------+
*/
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_RIGHT_DOWN
// 3) Create the runtime objects to use
// placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// placeholder for the virtual display object
VirtualMatrixPanel *virtualDisp = nullptr;
/******************************************************************************
* Setup!
******************************************************************************/
void setup() {
delay(2000);
Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println(" HELLO !");
Serial.println("*****************************************************");
/******************************************************************************
* Create physical DMA panel class AND virtual (chained) display class.
******************************************************************************/
/*
The configuration for MatrixPanel_I2S_DMA object is held in HUB75_I2S_CFG structure,
All options has it's predefined default values. So we can create a new structure and redefine only the options we need
Please refer to the '2_PatternPlasma.ino' example for detailed example of how to use the MatrixPanel_I2S_DMA configuration
*/
HUB75_I2S_CFG mxconfig(
PANEL_RES_X, // module width
PANEL_RES_Y, // module height
PANEL_CHAIN // chain length
);
//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
// Sanity checks
if (NUM_ROWS <= 1) {
Serial.println(F("There is no reason to use the VirtualDisplay class for a single horizontal chain and row!"));
}
// OK, now we can create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
// let's adjust default brightness to about 75%
dma_display->setBrightness8(192); // range is 0-255, 0 - 0%, 255 - 100%
// Allocate memory and start DMA display
if( not dma_display->begin() )
Serial.println("****** !KABOOM! I2S memory allocation failed ***********");
// create VirtualDisplay object based on our newly created dma_display object
virtualDisp = new VirtualMatrixPanel((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
// So far so good, so continue
virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
virtualDisp->drawDisplayTest(); // draw text numbering on each screen to check connectivity
// delay(1000);
Serial.println("Chain of 4x 64x32 panels for this example:");
Serial.println("+---------+---------+");
Serial.println("| 4 | 3 |");
Serial.println("| | |");
Serial.println("+---------+---------+");
Serial.println("| 1 | 2 |");
Serial.println("| (ESP32) | |");
Serial.println("+---------+---------+");
// draw blue text
virtualDisp->setFont(&FreeSansBold12pt7b);
virtualDisp->setTextColor(virtualDisp->color565(0, 0, 255));
virtualDisp->setTextSize(3);
virtualDisp->setCursor(0, virtualDisp->height()- ((virtualDisp->height()-45)/2));
virtualDisp->print("ABCD");
// Red text inside red rect (2 pix in from edge)
virtualDisp->drawRect(1,1, virtualDisp->width()-2, virtualDisp->height()-2, virtualDisp->color565(255,0,0));
// White line from top left to bottom right
virtualDisp->drawLine(0,0, virtualDisp->width()-1, virtualDisp->height()-1, virtualDisp->color565(255,255,255));
virtualDisp->drawDisplayTest(); // re draw text numbering on each screen to check connectivity
}
void loop() {
} // end loop
/*****************************************************************************
Thanks to:
* Brian Lough for the original example as raised in this issue:
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/26
YouTube: https://www.youtube.com/brianlough
Tindie: https://www.tindie.com/stores/brianlough/
Twitter: https://twitter.com/witnessmenow
* Galaxy-Man for the kind donation of panels make/test that this is possible:
https://github.com/Galaxy-Man
*****************************************************************************/
panel can display even will be cut in middle
I'll take a look and write later
i remove
if ( coords.x & 64) { coords.x -= 64; coords.y +=32; }
and this what i got but when I didn't remove it panel is blank
Please show a full code
here is full code
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
/* Use a custom Virtual Display class to re-map co-ordinates such that they draw
correctly on a 32x16 1/4 Scan panel (or chain of such panels).
*/
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
/* ================================================== */
// Define custom class derived from VirtualMatrixPanel
class EightPxBasePanel : public VirtualMatrixPanel
{
public:
using VirtualMatrixPanel::VirtualMatrixPanel; // inherit VirtualMatrixPanel's constructor(s)
protected:
VirtualCoords getCoords(int16_t x, int16_t y); // custom getCoords() method for specific pixel mapping
};
inline VirtualCoords EightPxBasePanel ::getCoords(int16_t x, int16_t y) {
coords = VirtualMatrixPanel::getCoords(x, y); // first call base class method to update coords for chaining approach
if ( coords.x == -1 || coords.y == -1 ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range!
return coords;
}
// if ( coords.x & 64) {
// coords.x -= 64;
// coords.y +=32;
// }
}
/* ================================================== */
// Panel configuration
#define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
#define PANEL_RES_Y 32 // 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 PANEL_CHAIN NUM_ROWS*NUM_COLS
// ^^^ NOTE: DEFAULT EXAMPLE SETUP IS FOR A CHAIN OF TWO x 1/8 SCAN PANELS
// Change this to your needs, for details on VirtualPanel pls read the PDF!
#define SERPENT true
#define TOPDOWN false
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_TOP_RIGHT_DOWN
// placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// placeholder for the virtual display object
EightPxBasePanel *FourScanPanel = nullptr;
/******************************************************************************
Setup!
******************************************************************************/
void setup()
{
delay(250);
Serial.begin(115200);
Serial.println(""); Serial.println(""); Serial.println("");
Serial.println("*****************************************************");
Serial.println("* 1/32 Scan Panel Demonstration *");
Serial.println("*****************************************************");
/*
// 62x32 1/8 Scan Panels don't have a D and E pin!
HUB75_I2S_CFG::i2s_pins _pins = {
R1_PIN, G1_PIN, B1_PIN, R2_PIN, G2_PIN, B2_PIN,
A_PIN, B_PIN, C_PIN, D_PIN, E_PIN,
LAT_PIN, OE_PIN, CLK_PIN
};
*/
HUB75_I2S_CFG mxconfig(
PANEL_RES_X , // DO NOT CHANGE THIS
PANEL_RES_Y * 2, // DO NOT CHANGE THIS
PANEL_CHAIN // DO NOT CHANGE THIS
//,_pins // Uncomment to enable custom pins
);
mxconfig.clkphase = false; // Change this if you see pixels showing up shifted wrongly by one column the left or right.
mxconfig.gpio.e = 32;
//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
// OK, now we can create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
// let's adjust default brightness to about 75%
dma_display->setBrightness8(192); // range is 0-255, 0 - 0%, 255 - 100%
// Allocate memory and start DMA display
if ( not dma_display->begin() )
Serial.println("****** !KABOOM! I2S memory allocation failed ***********");
// create FourScanPanellay object based on our newly created dma_display object
FourScanPanel = new EightPxBasePanel ((*dma_display), NUM_ROWS, NUM_COLS, PANEL_RES_X, PANEL_RES_Y, VIRTUAL_MATRIX_CHAIN_TYPE);
dma_display->clearScreen();
delay(500);
// THE IMPORTANT BIT BELOW!
// FOUR_SCAN_16PX_HIGH
// FOUR_SCAN_32PX_HIGH
// **** You don't need to set PhysicalPanelScanRate when use your own virtual panel class
//FourScanPanel->setPhysicalPanelScanRate(FOUR_SCAN_16PX_HIGH);
}
// Test the pixel mapping - fill the panel pixel by pixel
void loop() {
for (int i = 0; i < FourScanPanel->height(); i++)
{
for (int j = 0; j < FourScanPanel->width(); j++)
{
FourScanPanel->drawPixel(j, i, FourScanPanel->color565(255, 255, 255));
// Print coordinates
Serial.print("(");
Serial.print(j);
Serial.print(",");
Serial.print(i);
Serial.print(") ");
delay(30);
}
}
delay(2000);
dma_display->clearScreen();
} // end loop
I just use 1 panel for code, The second panel should do the same thing but instead, it is blank
that p3 64x32 and have scan 1/32s I have some problems using this panel
https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA/assets/108962994/53a9be78-c899-4656-82f2-2f72d2063595
here my code `#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
//**** Display Config Declaration
define double_buffer
define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module.
define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module.
define PANEL_CHAIN 2 // Total number of panels chained one to another
MatrixPanel_I2S_DMA* dma_display = nullptr;
define FONT_SIZE 2.85 // Text will be FONT_SIZE x 8 pixels tall.
int delayBetweeenAnimations = 35; // How fast it scrolls, Smaller == faster int scrollXMove = -1; //If positive it would scroll right
int textXPosition = PANEL_RES_X PANEL_CHAIN; // Number of pixels wide of each INDIVIDUAL panel module. // Will start one pixel off screen int textYPosition = PANEL_RES_Y / 2 - (FONT_SIZE 8 / 2); // This will center the text
// For scrolling Text unsigned long isAnimationDue;
String text ="Restek";
uint16_t myBLACK = dma_display->color565(0, 0, 0); uint16_t myWHITE = dma_display->color565(255, 255, 255); uint16_t myRED = dma_display->color565(255, 0, 0); uint16_t myGREEN = dma_display->color565(0, 255, 0); uint16_t myBLUE = dma_display->color565(0, 0, 255);
// Will be used in getTextBounds. int16_t xOne, yOne; uint16_t w, h;
void setup() {
Serial.begin(115200);
// Configurations for Display HUB75_I2S_CFG mxconfig( PANEL_RES_X, // module width PANEL_RES_Y, // module height PANEL_CHAIN // Chain length );
mxconfig.double_buff = true; mxconfig.gpio.e = 32; // mxconfig.clkphase = false; // mxconfig.driver = HUB75_I2S_CFG::FM6124;
// Display Setup dma_display = new MatrixPanel_I2S_DMA(mxconfig); dma_display->begin(); dma_display->setBrightness8(255); //0-255 dma_display->fillScreen(myBLACK); dma_display->setTextSize(FONT_SIZE); dma_display->setTextWrap(false); // N.B!! Don't wrap at end of line dma_display->setTextColor(myRED); // Can change the colour here
}
void loop(){ unsigned long now = millis(); if (now > isAnimationDue) { // This tells the code to update the second buffer dma_display->flipDMABuffer();
} }`
as any one have suggest for fix this