refactor: consistency LedMetrix32x16::begin parameters by removing resolution arguments

main
a2nr 2025-06-10 22:28:56 +07:00
parent 9618c1bdb2
commit bb63725781
3 changed files with 5 additions and 3 deletions

View File

@ -61,8 +61,10 @@ LedMetrix32x16::LedMetrix32x16()
_pins.clk = CLK_PIN_DEFAULT;
}
void LedMetrix32x16::begin(int nRow, int nColl, int res_x, int res_y, PANEL_CHAIN_TYPE chain_type )
void LedMetrix32x16::begin(int nRow, int nColl, PANEL_CHAIN_TYPE chain_type )
{
int res_x = 32;
int res_y = 16;
HUB75_I2S_CFG mxconfig (
res_x * 2, // width of a single panel
res_y / 2, // height of a single panel

View File

@ -24,7 +24,7 @@ private:
public:
LedMetrix32x16();
LedMetrix32x16(HUB75_I2S_CFG::i2s_pins _pins);
void begin(int nRow, int nColl, int res_x, int res_y, PANEL_CHAIN_TYPE chain_type = CHAIN_BOTTOM_RIGHT_UP);
void begin(int nRow, int nColl, PANEL_CHAIN_TYPE chain_type = CHAIN_BOTTOM_RIGHT_UP);
inline MatrixPanel_I2S_DMA * getDisplay() { return dma_display; } // return pointer to the DMA display object
inline CustomPxBasePanel * getVirtualDisplay() { return virtual_display; } // return pointer to the virtual display object

View File

@ -6,7 +6,7 @@ LedMetrix32x16 ledMatrix; // Create an instance of the LedMetrix32x16 class
void setup() {
Serial.begin(115200); // Initialize serial communication for debugging
ledMatrix.begin(1, 3, 32, 16); // Initialize the LED matrix with 1 rows and 3 column of panels, each panel being 32x16 pixels
ledMatrix.begin(1, 3); // Initialize the LED matrix with 1 rows and 3 column of panels
MatrixPanel_I2S_DMA *display = ledMatrix.getDisplay(); // Get the DMA display object
display->setBrightness(50); // Set the brightness of the display to 50%
}