Great job to you guys #155
Replies: 11 comments 26 replies
-
Thank you! I especially like 'ESP32-Hub75.mp4' - great selection of hot women. Probably the best use of this library so far. You're actually driving 12 panels? That's amazing. Edit: The cube is epic. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Sorry, quoted wrongly… total pixels is 256 x 96. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late reply. I've been busy for the past few days.
Here you are the back panels photos. I did not modify any of the
library. Just add the sd card
library into the arduino sketch & stored all the animated gif files into
sd card.
Regards,
David Chiang
…On 19/12/2021 10:14 am, TimJRo wrote:
Great!!!
Can you show a pic of the back side of the panels - interested to see
thee wiring and ribbon cables.
Did you have to modify anything in the library to get 12 panels working?
—
Reply to this email directly, view it on GitHub
<#155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYLDIR3CF6EHE6U67IWK6TURU5ZNANCNFSM5KLKQMNA>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Here are the gpio I use for my micro sd card on the esp32.
#include <AnimatedGIF.h>
#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>
#include "SD.h"
#include "SPI.h"
// Micro SD Card Module Pinout
// VCC = 5V
// GND = GND
#define HSPI_MISO 19
#define HSPI_MOSI 4
#define HSPI_SCLK 14
#define HSPI_CS 5
// Led Panel Pinout
#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 13
#define LAT_PIN 32
#define OE_PIN 33
#define CLK_PIN 15
// Configure for your panel(s) as appropriate!
#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 3 // Number of Vertical rows of chained panels
#define NUM_COLS 4 // Number of Horizontal rows of chained panels
Regards,
David Chiang
…On 23/6/2022 5:36 pm, zCrystal94 wrote:
Hi, what gpio did you use for sdcard?
—
Reply to this email directly, view it on GitHub
<#155 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYLDIRIHUX46WILZ3O2OXTVQQVZLANCNFSM5KLKQMNA>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sorry, I just went through my email & I missed out your this email. SCK
or SCLK is the same. Is the serial clock pin
on the sd card module. U can #define any name you wanted as long as the
name match the card mounting process.
Enclosed herewith a photo of the sd card module that I'm using.
On the Arduino IDE setup()
Serial.println("Micro SD Card Mounting...");
spi = new SPIClass(HSPI);
spi->begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_CS);
SD.begin(HSPI_CS, *spi);
delay(50);
if (!SD.begin(HSPI_CS, *spi)) {
Serial.println("Card Mount Failed");
return;
}
uint8_t cardType = SD.cardType();
if (cardType == CARD_NONE) {
Serial.println("No SD card attached");
return;
}
Serial.print("SD Card Type: ");
if (cardType == CARD_MMC) {
Serial.println("MMC");
} else if(cardType == CARD_SD){
Serial.println("SDSC");
} else if(cardType == CARD_SDHC){
Serial.println("SDHC");
} else {
Serial.println("UNKNOWN");
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
Regards,
David Chiang
…On 24/6/2022 3:43 pm, zCrystal94 wrote:
Hi, i cheked all the sdcard modules and i found only modules that have
SCK and not SCLK for pin 14. Is there any difference?
—
Reply to this email directly, view it on GitHub
<#155 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYLDIS7TQX6LYR3QJSZRCLVQVRI7ANCNFSM5KLKQMNA>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Attached herewith the code.
Regards,
David Chiang
On 29/8/2022 2:46 am, GrimorJander wrote:
Here are the gpio I use for my micro sd card on the esp32.
#include <AnimatedGIF.h> #include
<ESP32-VirtualMatrixPanel-I2S-DMA.h> #include "SD.h" #include
"SPI.h" // Micro SD Card Module Pinout // VCC = 5V // GND = GND
#define HSPI_MISO 19 #define HSPI_MOSI 4 #define HSPI_SCLK 14
#define HSPI_CS 5 // Led Panel Pinout #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 13 #define LAT_PIN 32 #define
OE_PIN 33 #define CLK_PIN 15 // Configure for your panel(s) as
appropriate! #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 3 //
Number of Vertical rows of chained panels #define NUM_COLS 4 //
Number of Horizontal rows of chained panels Regards, David Chiang
… <#>
On 23/6/2022 5:36 pm, zCrystal94 wrote: Hi, what gpio did you use
for sdcard? — Reply to this email directly, view it on GitHub
<#155 (reply in thread)
<#155 (reply in thread)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AUYLDIRIHUX46WILZ3O2OXTVQQVZLANCNFSM5KLKQMNA.
You are receiving this because you authored the thread.Message ID:
/*@*/.***>
Can you share the whole code? thanks
—
Reply to this email directly, view it on GitHub
<#155 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYLDIXLLATFNU5GRHTMUIDV3OXZLANCNFSM5KLKQMNA>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
/*
Compiled with 'ESP32 Dev Module' with Micro SD card module.
Create a 'gifs' directory on the SD card & put all the gif files in this folder.
Using 12 Led panel module, each panel is 64x32 pixels.
Total pixels (width)256 x (height)96.
To resize animated gif, use this online website: https://ezgif.com/
*/
#include <AnimatedGIF.h>
#include <ESP32-VirtualMatrixPanel-I2S-DMA.h>
#include "SD.h"
#include "SPI.h"
// Micro SD Card Module Pinout
// VCC = 5V
// GND = GND
#define HSPI_MISO 19
#define HSPI_MOSI 4
#define HSPI_SCLK 14
#define HSPI_CS 5
// Led Panel Pinout
#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 13
#define LAT_PIN 32
#define OE_PIN 33
#define CLK_PIN 15
// Configure for your panel(s) as appropriate!
#define PANEL_RES_X 64 // Number of pixels width of each individual panel module.
#define PANEL_RES_Y 32 // Number of pixels height of each individual panel module.
#define NUM_ROWS 3 // Number of Vertical rows of chained panels
#define NUM_COLS 4 // Number of Horizontal rows of chained panels
#define PANEL_CHAIN NUM_ROWS*NUM_COLS // Total number of panels chained one to another
// Change this to your needs, for details on VirtualPanel pls see ChainedPanels example
#define SERPENT false
#define TOPDOWN false
// Placeholder for the matrix object
MatrixPanel_I2S_DMA *dma_display = nullptr;
// Placeholder for the virtual display object
VirtualMatrixPanel *virtualDisp = nullptr;
SPIClass *spi = NULL;
AnimatedGIF gif;
File f;
int x_offset, y_offset;
// ======== Draw a line of image directly on the LED Matrix =========
void GIFDraw(GIFDRAW *pDraw) {
uint8_t *s;
uint16_t *d, *usPalette, usTemp[320];
int x, y, iWidth;
iWidth = pDraw->iWidth;
if (iWidth > MATRIX_WIDTH)
iWidth = MATRIX_WIDTH;
usPalette = pDraw->pPalette;
y = pDraw->iY + pDraw->y; // current line
s = pDraw->pPixels;
if (pDraw->ucDisposalMethod == 2) { // restore to background color
for (x=0; x<iWidth; x++)
{
if (s[x] == pDraw->ucTransparent)
s[x] = pDraw->ucBackground;
}
pDraw->ucHasTransparency = 0;
}
// Apply the new pixels to the main image
if (pDraw->ucHasTransparency) { // if transparency used
uint8_t *pEnd, c, ucTransparent = pDraw->ucTransparent;
int x, iCount;
pEnd = s + pDraw->iWidth;
x = 0;
iCount = 0; // count non-transparent pixels
while(x < pDraw->iWidth)
{
c = ucTransparent-1;
d = usTemp;
while (c != ucTransparent && s < pEnd)
{
c = *s++;
if (c == ucTransparent) // done, stop
{
s--; // back up to treat it like transparent
}
else // opaque
{
*d++ = usPalette[c];
iCount++;
}
} // while looking for opaque pixels
if (iCount) { // any opaque pixels?
for(int xOffset = 0; xOffset < iCount; xOffset++ ) {
virtualDisp->drawPixelRGB565(x + xOffset, y, usTemp[xOffset]);
}
x += iCount;
iCount = 0;
}
// No, look for a run of transparent pixels
c = ucTransparent;
while (c == ucTransparent && s < pEnd) {
c = *s++;
if (c == ucTransparent)
iCount++;
else
s--;
}
if (iCount) {
x += iCount; // skip these
iCount = 0;
}
}
}
else { // does not have transparency
s = pDraw->pPixels;
// Translate the 8-bit pixels through the RGB565 palette (already byte reversed)
for (x=0; x<pDraw->iWidth; x++)
{
virtualDisp->drawPixelRGB565(x, y, usPalette[*s++]);
}
}
}
// ================= Open Gif File ====================
void * GIFOpenFile(const char *fname, int32_t *pSize) {
f = SD.open(fname); // For SD Card
if (f) {
*pSize = f.size();
return (void *)&f;
}
return NULL;
}
// ================= Close Gif File ====================
void GIFCloseFile(void *pHandle) {
File *f = static_cast<File *>(pHandle);
if (f != NULL)
f->close();
}
// ===================== Read Gif File =======================
int32_t GIFReadFile(GIFFILE *pFile, uint8_t *pBuf, int32_t iLen) {
int32_t iBytesRead;
iBytesRead = iLen;
File *f = static_cast<File *>(pFile->fHandle);
// Note: If you read a file all the way to the last byte, seek() stops working
if ((pFile->iSize - pFile->iPos) < iLen)
iBytesRead = pFile->iSize - pFile->iPos - 1; // <-- ugly work-around
if (iBytesRead <= 0)
return 0;
iBytesRead = (int32_t)f->read(pBuf, iBytesRead);
pFile->iPos = f->position();
return iBytesRead;
}
// ================= Seek Gif File ====================
int32_t GIFSeekFile(GIFFILE *pFile, int32_t iPosition) {
int i = micros();
File *f = static_cast<File *>(pFile->fHandle);
f->seek(iPosition);
pFile->iPos = (int32_t)f->position();
i = micros() - i;
// Serial.printf("Seek time = %d us\n", i);
return pFile->iPos;
}
// ================= Show Gif ====================
unsigned long start_tick = 0;
void ShowGIF(char *name) {
start_tick = millis();
if (gif.open(name, GIFOpenFile, GIFCloseFile, GIFReadFile, GIFSeekFile, GIFDraw))
{
x_offset = (MATRIX_WIDTH - gif.getCanvasWidth())/2;
if (x_offset < 0) x_offset = 0;
y_offset = (MATRIX_HEIGHT - gif.getCanvasHeight())/2;
if (y_offset < 0) y_offset = 0;
Serial.printf("Successfully opened GIF; Canvas size = %d x %d\n", gif.getCanvasWidth(), gif.getCanvasHeight());
Serial.println();
// Serial.println(gif.getCanvasWidth());
// Serial.println(gif.getCanvasHeight());
Serial.flush();
while (gif.playFrame(true, NULL))
{
if ( (millis() - start_tick) > 8000) { // we'll get bored after about 8 seconds of the same looping gif
break;
}
}
gif.close();
}
}
// ======================== Setup =========================
void setup() {
Serial.begin(115200);
delay(180);
Serial.println("Micro SD Card Mounting...");
spi = new SPIClass(HSPI);
spi->begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_CS);
SD.begin(HSPI_CS, *spi);
delay(50);
if (!SD.begin(HSPI_CS, *spi)) {
Serial.println("Card Mount Failed");
return;
}
uint8_t cardType = SD.cardType();
if (cardType == CARD_NONE) {
Serial.println("No SD card attached");
return;
}
Serial.print("SD Card Type: ");
if (cardType == CARD_MMC) {
Serial.println("MMC");
} else if(cardType == CARD_SD){
Serial.println("SDSC");
} else if(cardType == CARD_SDHC){
Serial.println("SDHC");
} else {
Serial.println("UNKNOWN");
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
Serial.println();
// Manually configured GPIO pins assigned to: _pins
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};
// (width, height, chain length, manual pin mapping, driver chip)
HUB75_I2S_CFG mxconfig(PANEL_RES_X, PANEL_RES_Y, PANEL_CHAIN, _pins, HUB75_I2S_CFG::FM6126A);
// FM6126A panels could be clocked at 10MHz or 20MHz with no visual artefacts
mxconfig.i2sspeed = HUB75_I2S_CFG::HZ_20M;
// Create our matrix object
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
// Range is 0-255. 0=0%, 50=20%, 100=40%, 150=60%, 200=80%, 255 = 100%
dma_display->setBrightness8(180);
// 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, true);
// Allocate memory and start DMA display
if( not dma_display->begin() )
Serial.println("****** !KABOOM! I2S memory allocation failed ***********");
Serial.println();
// Fill the screen with 'black'
// virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
virtualDisp->fillScreen(virtualDisp->color444(180, 0, 0));
delay(1000);
virtualDisp->fillScreen(virtualDisp->color444(0, 180, 0));
delay(1000);
virtualDisp->fillScreen(virtualDisp->color444(0, 0, 180));
delay(1000);
virtualDisp->fillScreen(virtualDisp->color444(80, 180, 180));
delay(1000);
virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
delay(1000);
virtualDisp->setFont(&FreeSansBold12pt7b);
virtualDisp->setTextColor(virtualDisp->color565(0, 100, 100));
virtualDisp->setTextSize(3);
// virtualDisp->setCursor(10, virtualDisp->height()-20);
virtualDisp->setCursor(43, virtualDisp->height() - 26);
// Red text inside red rect
virtualDisp->print("1234");
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->drawLine(0,0, virtualDisp->width()-0, virtualDisp->height()-0, virtualDisp->color565(255,255,255));
delay(5000);
virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
Serial.println("Starting AnimatedGIFs Sketch");
gif.begin(LITTLE_ENDIAN_PIXELS);
delay(50);
}
// ======================== Loop =========================
void loop() {
char *szDir = "/gifs"; // Play all GIFs in this directory on the SD card
char fname[256];
File root, temp;
while (1) // Run forever
{
root = SD.open(szDir); // For SD card
if (root)
{
temp = root.openNextFile();
while (temp)
{
if (!temp.isDirectory()) // Play it
{
strcpy(fname, temp.name());
Serial.printf("Playing %s\n", temp.name());
Serial.flush();
ShowGIF((char *)temp.name());
}
temp.close();
temp = root.openNextFile();
}
root.close();
} // root
delay(100); // pause before restarting
virtualDisp->fillScreen(virtualDisp->color444(0, 0, 0));
} // while
}
|
Beta Was this translation helpful? Give feedback.
-
i cannot seem to get this to run, i get this from the console, `*** ESP32-HUB75-MatrixPanel-I2S-DMA: Memory Allocations Complete *** Core 0 register dump: Backtrace:0x400d2b87:0x3ffb26800x400d3071:0x3ffb26a0 0x400d3579:0x3ffb26e0 0x400d1cb9:0x3ffb27b0 0x400d823e:0x3ffb2820 ` i am using library 2.0.2 since that's the latest one that seems to have the right calls you used in it still. i also have setup my pins as follows: // Led Panel Pinout #define HSPI_MISO 21 |
Beta Was this translation helpful? Give feedback.
-
Hi Grimor,
It was 14 months ago I compiled the sketch with the attached library. I
do not know what version was that.
I tried to compile with the current version 2.0.7 & is giving me these
errors below here. Currently I'm using..
Arduino IDE v1.8.19
ArduinoJson v6.19.4
Board Manager v2.0.4
I guess these are just the links problem on the latest library.
Led_Matrix_Hub75_GIF_SDcard_12x64x32_test:124:26: error: 'class
VirtualMatrixPanel' has no member named 'drawPixelRGB565';
did you mean 'drawPixelRGB888'?
virtualDisp->drawPixelRGB565(x + xOffset, y, usTemp[xOffset]);
^~~~~~~~~~~~~~~
drawPixelRGB888
Led_Matrix_Hub75_GIF_SDcard_12x64x32_test:156:22: error: 'class
VirtualMatrixPanel' has no member named 'drawPixelRGB565';
did you mean 'drawPixelRGB888'?
virtualDisp->drawPixelRGB565(x, y, usPalette[*s++]);
^~~~~~~~~~~~~~~
drawPixelRGB888
exit status 1
'class VirtualMatrixPanel' has no member named 'drawPixelRGB565'; did
you mean 'drawPixelRGB888'?
To define which GPIO use are very inportant & I saw the GPIO use on
yours are slightly different from mine.
Some GPIO are set HIGH internally at boot time & some GPIO if pulled
HIGH at boot time or during compile
can give serious problem.. like Guru Meditation Error.
Try using the attached library first & also check on the setting to see
how it goes. Have fun!
Regards,
David Chiang
…On 15/9/2022 5:06 am, GrimorJander wrote:
i cannot seem to get this to run, i get this from the console,
`*** ESP32-HUB75-MatrixPanel-I2S-DMA: Memory Allocations Complete
*** Total memory that was reserved: 38 kB. ... of which was used
for the DMA Linked List(s): 6 kB. Heap Memory Available: 244576
bytes total. Largest free block: 110580 bytes. General RAM
Available: 178316 bytes total. Largest free block: 110580 bytes.
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception
was unhandled.
Core 0 register dump: PC : 0x400d2b8a PS : 0x00060030 A0 :
0x800d3074 A1 : 0x3ffb2680 A2 : 0x0000001d A3 : 0x000000b7 A4 :
0x400812c4 A5 : 0x3ffb989c A6 : 0x00000000 A7 : 0x00000001 A8 :
0xc0100000 A9 : 0x00000000 A10 : 0x00013ffc A11 : 0x000000b6 A12 :
0x0ffd114c A13 : 0x00000000 A14 : 0x00000000 A15 : 0xffffffff SAR
: 0x00000009 EXCCAUSE: 0x0000001c EXCVADDR: 0x00000000 LBEG :
0x4008665c LEND : 0x40086667 LCOUNT : 0xffffffff
Backtrace:0x400d2b87:0x3ffb26800x400d3071:0x3ffb26a0
0x400d3579:0x3ffb26e0 0x400d1cb9:0x3ffb27b0 0x400d823e:0x3ffb2820 `
i am using library 2.0.2 since that's the latest one that seems to
have the right calls you used in it still. i also have setup my
pins as follows:
// Led Panel Pinout #define R1_PIN 25 #define G1_PIN 26 #define
B1_PIN 27 #define R2_PIN 14 #define G2_PIN 12 #define B2_PIN 13
#define A_PIN 23 #define B_PIN 29 #define C_PIN 5 #define D_PIN 17
#define E_PIN 18 #define LAT_PIN 4 #define OE_PIN 15 #define
CLK_PIN 16
#define HSPI_MISO 21 #define HSPI_MOSI 32 #define HSPI_SCLK 22
#define HSPI_CS 33
Look at this post:
#315 (comment)
<#315 (comment)>
I got it working with the last version of the library and the SD
pinout you can see in the code.
—
Reply to this email directly, view it on GitHub
<#155 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYLDIXYYFAAI5YOOAVNRBLV6I44XANCNFSM5KLKQMNA>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@GrimorJander @Dcmwrnd I have made some changes to the sketch and have tested it. So far it's working for me with the latest library and compiled it with Arduino 1.8.19. I created two sketches, one for a single matrix and the other one for cascaded matrixes. |
Beta Was this translation helpful? Give feedback.
-
Awesome!. I have two doubts to improve it: Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
This is a fantastic library. I’m using 12 pcs P4 panels (64 x 32 pixels). Did not expect this ESP32 is so powerful.
Thank you to all you guys. Below here are some video links using VirtualMatrixPanel library.
http://www.dcmw.com.my/video/ESP32-Hub75.mp4
http://www.dcmw.com.my/video/ESP32-Spectrum-12x64x32.mp4
http://www.dcmw.com.my/video/LedPanels.mp4
Beta Was this translation helpful? Give feedback.
All reactions