Hello,
Im jocelyn from France,
I started to use rpi-rgb-led-matrix library to setup a 960x16 px display on a raspberry pi 3b+ wit P10 RGB panels.
My program is finished and work well on a single chain of length 9 panels.
Today I tried to wire the whole screen using --led-parallel {CHAIN_1 Panel 1->9} {CHAIN_2 Panel 10->18} {CHAIN_3 Panel 19->27}
The wiring seems correct because i can set the whole background to a certain color.
i use theses parameters for now ‘–led-chain=9 --led-rows=16 --led-parallel=3 --led-cols=32’
As I understand I will need a custom mapper to rearange all my panel in a single row.
Can somebody provide me help to deals with the correct mappers to use?
Thanks in advance
With this custom mapper in c++ in pixel-mapper.cc it seems to work for my case. (the implementation is not generic at all)
I don’t know if a simpler solution was available.
Do not hesitate to comment if you have it.
// |--- Pi connector |--- Pi connector |--- Pi connector
// [>][>][>][>][>][>][>][>][>]#[>][>][>][>][>][>][>][>][>]#[>][>][>][>][>][>][>][>][>]
class OneLinePixelMapper : public PixelMapper {
public:
OneLinePixelMapper() {}
virtual const char *GetName() const { return "OneLine"; }
virtual bool SetParameters(int chain, int parallel, const char *param) {
if (param == NULL || strlen(param) == 0) {
return true;
}
return false;
}
virtual bool GetSizeMapping(int matrix_width, int matrix_height,
int *visible_width, int *visible_height)
const {
*visible_height = matrix_height/3;
*visible_width = 3*matrix_width;
return true;
}
virtual void MapVisibleToMatrix(int matrix_width, int matrix_height,
int x, int y,
int *matrix_x, int *matrix_y) const {
if( y > 0 && y <=matrix_height) {
if( x > 0 && x <= matrix_width ) {
*matrix_x = x;
*matrix_y=y;
}
else if( x > matrix_width && x <= 2 * matrix_width ) {
*matrix_x = x - matrix_width;
*matrix_y = y + matrix_height;
}
else if( x > 2 * matrix_width && x <= 3 * matrix_width ) {
*matrix_x = x - 2 * matrix_width;
*matrix_y = y + 2 * matrix_height;
}
}
else {
*matrix_x = matrix_width;
*matrix_y = matrix_height;
}
}
};
1 Like