-
Notifications
You must be signed in to change notification settings - Fork 297
Description
Hiya!
First of all, thank you for the amazing library which allows us to control the LED screens. I've been wondering arround for a few weeks now trying to get these screens to work. I'm getting close but no sigar yet.
So i'm using this screen from our good friends over in China:
1/4 scan P8 32 x 16 pixels.
Chips:
ICN2038S
SM16208S
MW245B
1A0802 (could also be IA0802)
I'm using the latest version (3.0.12) of the library.
I've gotten the screen to work and printing Hello. This resulted in the horizontal lines showing multiple horizontal lines, instead of just one. In example:
Whilst i expected the letter H to be printed as is, but it got printed as multiple horizontal lines connecting the 2 |
So i fiddled around with the code and reverted to the default loop pattern to see what is going wrong. It does fill all screens but it keeps on doing weird stuff with the lines, as shown in the video. It overlaps the same row for some time and then goes on to the next one.
Using default pinout as stated in the HUB75 documentation, with the ABCD pins connected to their corresponding pins.
This is the code i'm using. My guess is that there is still something wrong with the virtualcoords being set incorrectly, but i cannot figure it out.
I've also tried just running 1 screen without the chains, but this doenst change anything unfortunatelly.
What am i doing wrong? How can i test this further to make sure this works? I've been trying for some weeks now and kinda running into a dead end. I've attached the video on Youtube since i cannot upload it into Github.
Thanks for any suggestions!
#include <Arduino.h>
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h>
#include "ESP32-VirtualMatrixPanel-I2S-DMA.h"
class EightPxBasePanel : public VirtualMatrixPanel {
public:
using VirtualMatrixPanel::VirtualMatrixPanel;
protected:
VirtualCoords getCoords(int16_t x, int16_t y);
};
inline VirtualCoords EightPxBasePanel::getCoords(int16_t x, int16_t y) {
coords = VirtualMatrixPanel::getCoords(x, y);
if (coords.x == -1 || coords.y == -1) return coords;
const uint8_t pxbase = 8;
if ((coords.y & 2) == 0) {
coords.x = (coords.x / pxbase) * 2 * pxbase + 7 - (coords.x & 0x7);
} else {
coords.x = coords.x + ((coords.x / pxbase) + 1) * pxbase;
}
coords.y = (coords.y >> 2) * 2 + (coords.y & 0b00000001);
return coords;
}
#define PANEL_RES_X 32
#define PANEL_RES_Y 16
#define NUM_ROWS 2
#define NUM_COLS 2
#define VIRTUAL_MATRIX_CHAIN_TYPE CHAIN_BOTTOM_LEFT_UP
MatrixPanel_I2S_DMA *dma_display = nullptr;
EightPxBasePanel *vPanel = nullptr;
void setup() {
delay(250);
Serial.begin(115200);
HUB75_I2S_CFG mxconfig(PANEL_RES_X * 2, PANEL_RES_Y / 2, NUM_ROWS * NUM_COLS);
mxconfig.clkphase = false;
mxconfig.driver = HUB75_I2S_CFG::ICN2038S;
mxconfig.i2sspeed = HUB75_I2S_CFG::HZ_20M;
mxconfig.latch_blanking = 1;
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->setBrightness(1);
if (!dma_display->begin()) {
Serial.println("I2S DMA begin() failed");
while (true) delay(1000);
}
dma_display->clearScreen();
vPanel = new EightPxBasePanel((*dma_display), NUM_ROWS, NUM_COLS,
PANEL_RES_X, PANEL_RES_Y,
VIRTUAL_MATRIX_CHAIN_TYPE);
}
void loop() {
for (int i = 0; i < vPanel->height(); i++)
{
for (int j = 0; j < vPanel->width(); j++)
{
vPanel->drawPixel(j, i, vPanel->color565(255, 0, 0));
delay(30);
}
}
delay(2000);
vPanel->clearScreen();
}