Closed saka2080 closed 8 months ago
Please add the line to the start of the code
#define RGB40x20_S5_saka2080 3,40,20,5,2
and show the video using this pattern
DMD_RGB <RGB40x20_S5_saka2080, COLOR_4BITS_Packed> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);
Sure. The full code and video are as following.
#include "DMD_RGB.h"
#define RGB40x20_S5_saka2080 3,40,20,5,2
//Number of panels in x and y axis
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
#define ENABLE_DUAL_BUFFER false
// ==== DMD_RGB pins ====
// mux pins - A, B, C... all mux pins must be selected from same port!
#define DMD_PIN_A PB6
#define DMD_PIN_B PB5
#define DMD_PIN_C PB4
uint8_t mux_list[] = { DMD_PIN_A , DMD_PIN_B , DMD_PIN_C };
// pin OE must be one of PB0 PB1 PA6 PA7
#define DMD_PIN_nOE PB0
#define DMD_PIN_SCLK PB7
uint8_t custom_rgbpins[] = { PA15, PA0,PA1,PA2,PA3,PA4,PA5 }; // CLK, R0, G0, B0, R1, G1, B1
DMD_RGB <RGB40x20_S5_saka2080, COLOR_4BITS_Packed> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);
uint16_t bg = 0; // background - black
uint16_t fg = 0; // foreground
void setup(void)
{
enableDebugPorts();
dmd.init();
fg = dmd.Color888(0, 0, 255);
dmd.setBrightness(50);
dmd.drawPixel(0,0, dmd.Color888(255, 0, 255));
delay(2000);
}
void loop(void) {
// fill the matrix with points row by row
for (int i = 0; i < dmd.height(); i++) {
for (int j = 0; j < dmd.width(); j++) {
dmd.drawPixel(j,i, fg);
delay(30);
}
}
// clear the screen
dmd.fillScreen(bg);
}
https://github.com/board707/DMD_STM32/assets/160825352/3f7c3c7e-8afd-4cfc-be00-cd6bad549c36
Thank you. It is a bit irregular... A good news - the panel works correct, and can be setup for the library.
I'll need some time to figure out how to work with this panel.
Could you add this code after #include "DMD_RGB.h"
line
#define RGB40x20_S5_saka2080_2 3,40,20,5,12
template <int MUX_CNT, int P_Width, int P_Height, int SCAN, int COL_DEPTH>
class DMD_RGB<MUX_CNT, P_Width, P_Height, SCAN, 12, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
byte panelsWide, byte panelsHigh, bool d_buf = false) :
DMD_RGB_BASE2<COL_DEPTH>(MUX_CNT, mux_list, _pin_nOE, _pin_SCLK, pinlist,
panelsWide, panelsHigh, d_buf, COL_DEPTH, SCAN, P_Width, P_Height)
{}
protected:
uint16_t get_base_addr(int16_t& x, int16_t& y) override {
this->transform_XY(x, y);
uint8_t pol_y = y % this->pol_displ;
static const uint8_t pix_base = 8;
x += (y / this->DMD_PIXELS_DOWN) * this->WIDTH;
uint16_t base_addr = (pol_y % this->nRows) * this->x_len +
(x / pix_base) * this->multiplex * pix_base +
(pol_y / this->nRows) * pix_base + x % pix_base;
return base_addr;
}
};
and show the video for this pattern RGB40x20_S5_saka2080_2 ?
It is not a solution, but just an additional test. Thank you
Thanks! Great!! it's much easier... try this:
#define RGB40x20_S5_saka2080_2 3,40,20,5,12
template <int MUX_CNT, int P_Width, int P_Height, int SCAN, int COL_DEPTH>
class DMD_RGB<MUX_CNT, P_Width, P_Height, SCAN, 12, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
byte panelsWide, byte panelsHigh, bool d_buf = false) :
DMD_RGB_BASE2<COL_DEPTH>(MUX_CNT, mux_list, _pin_nOE, _pin_SCLK, pinlist,
panelsWide, panelsHigh, d_buf, COL_DEPTH, SCAN, P_Width, P_Height)
{}
protected:
uint16_t get_base_addr(int16_t& x, int16_t& y) override {
this->transform_XY(x, y);
uint8_t pol_y = y % this->pol_displ;
static const uint8_t pix_base = 8;
x += (y / this->DMD_PIXELS_DOWN) * this->WIDTH;
uint16_t base_addr = (pol_y % this->nRows) * this->x_len +
(x / pix_base) * this->multiplex * pix_base +
(pol_y / this->nRows) * pix_base;
if (pol_y < this->nRows) base_addr += pix_base - x % pix_base - 1;
else base_addr +=x % pix_base ;
return base_addr;
}
};
Thanks. Great. It worked with the pixel. The problem is now with scrolling text. the example code for scrolling when run,it shows as in video:
https://github.com/board707/DMD_STM32/assets/160825352/c87282fe-fb8f-41e8-a0d1-a8bd9bd87bc8
Ooo I forget to disable fast text scroll. This should resolve the problem:
#define RGB40x20_S5_saka2080_2 3,40,20,5,12
template <int MUX_CNT, int P_Width, int P_Height, int SCAN, int COL_DEPTH>
class DMD_RGB<MUX_CNT, P_Width, P_Height, SCAN, 12, COL_DEPTH> : public DMD_RGB_BASE2<COL_DEPTH>
{
public:
DMD_RGB(uint8_t* mux_list, byte _pin_nOE, byte _pin_SCLK, uint8_t* pinlist,
byte panelsWide, byte panelsHigh, bool d_buf = false) :
DMD_RGB_BASE2<COL_DEPTH>(MUX_CNT, mux_list, _pin_nOE, _pin_SCLK, pinlist,
panelsWide, panelsHigh, d_buf, COL_DEPTH, SCAN, P_Width, P_Height)
{
this->fast_Hbyte = false;
this->use_shift = false;
}
// Fast text shift is disabled for complex patterns, so we don't need the method
void disableFastTextShift(bool shift) override {}
protected:
uint16_t get_base_addr(int16_t& x, int16_t& y) override {
this->transform_XY(x, y);
uint8_t pol_y = y % this->pol_displ;
static const uint8_t pix_base = 8;
x += (y / this->DMD_PIXELS_DOWN) * this->WIDTH;
uint16_t base_addr = (pol_y % this->nRows) * this->x_len +
(x / pix_base) * this->multiplex * pix_base +
(pol_y / this->nRows) * pix_base;
if (pol_y < this->nRows) base_addr += pix_base - x % pix_base - 1;
else base_addr +=x % pix_base ;
return base_addr;
}
};
Thank you so much. It works like charm. Great.
Thank you. Star the library if you satisfied it.
Pattern RGB40x20_S5_saka2080 added to the library v1.1.3. Now you can use it directly in the DMD class init
Hi, I am using P8 40x20 1/5 scan panel, it shows as video below when using
DMD_RGB <RGB40x20_S5_LNikon, COLOR_4BITS_Packed> dmd(mux_list, DMD_PIN_nOE, DMD_PIN_SCLK, custom_rgbpins, DISPLAYS_ACROSS, DISPLAYS_DOWN, ENABLE_DUAL_BUFFER);
https://github.com/board707/DMD_STM32/assets/160825352/32671cac-e72d-4e85-b0e4-378cb192c61b
Please suggest what should I do now.