Hi, i connected 32x16 single colored matrix to ESP32, and compiled it under platformio with Adafruit GFX. Display doesn’t show anything. Connections look correct.
I oscilloscoped signals and only colors signals aren’t toggling. When i added following line into MatrixEsp32Hub75Calc_Impl.h then all leds turning on with some brightness.
if (tempRow0[i+k].red & mask)
v|=BIT_R1;
if (tempRow0[i+k].green & mask)
v|=BIT_G1;
if (tempRow0[i+k].blue & mask)
v|=BIT_B1;
if (tempRow1[i+k].red & mask)
v|=BIT_R2;
if (tempRow1[i+k].green & mask)
v|=BIT_G2;
if (tempRow1[i+k].blue & mask)
v|=BIT_B2;
v|=BIT_R1;// added, matrix light up now
This is my main code:
#include <Arduino.h>
#include <MatrixHardware_ESP32_V0.h>
#define USE_ADAFRUIT_GFX_LAYERS
#include <SmartMatrix.h>
#define COLOR_DEPTH 24 // known working: 24, 48 - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24
const uint8_t kMatrixWidth = 32; // known working: 32, 64, 96, 128
const uint8_t kMatrixHeight = 16; // known working: 32 (untuk 1 baris), 64 (untuk 2 baris)
const uint8_t kRefreshDepth = 36; // known working: 24, 36, 48
const uint8_t kDmaBufferRows = 4; // known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate
const uint8_t kPanelType = SMARTMATRIX_HUB12_16ROW_32COL_MOD4SCAN; // use SMARTMATRIX_HUB75_16ROW_MOD8SCAN for common 16x32 panels
//const uint8_t kMatrixOptions = (SMARTMATRIX_OPTIONS_HUB12_MODE); // see http://docs.pixelmatix.com/SmartMatrix for options
const uint32_t kMatrixOptions = (SMARTMATRIX_OPTIONS_HUB12_MODE);// | SMARTMATRIX_OPTIONS_ESP32_INVERT_CLK);
SMARTMATRIX_ALLOCATE_BUFFERS(matrix, kMatrixWidth, kMatrixHeight, kRefreshDepth, kDmaBufferRows, kPanelType, kMatrixOptions);
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
const uint8_t kGFXMonoLayerOptions = (SM_GFX_MONO_OPTIONS_NONE);
//SMARTMATRIX_ALLOCATE_GFX_MONO_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kGFXMonoLayerOptions);
SMARTMATRIX_ALLOCATE_BACKGROUND_LAYER(backgroundLayer, kMatrixWidth, kMatrixHeight, COLOR_DEPTH, kBackgroundLayerOptions);
#define BLACK 0x0000
#define RED 0xF800
void setup() {
matrix.addLayer(&backgroundLayer);
matrix.setBrightness(10);
matrix.begin();
backgroundLayer.setTextColor(RED);
backgroundLayer.println("123");
backgroundLayer.swapBuffers();
}
void loop()
{
backgroundLayer.drawLine(0,0,32,16,0xffff);
backgroundLayer.swapBuffers();
delay(1000);
}
Any thoughts what wrong is?