Cross shaped screens disposition

Hi everyone !

I’m using 16x32 1/2 scan panel with ACME HAT-A3 and RPi 3B+.
I achieved to make them work well together in square shape, but now I’m trying to make a cross shape as below :
_____[I - O]
_____[I - O]
[I - O] [I - O] [I - O]
[I - O] [I - O] [I - O]
_____[I - O]
_____[I - O]

After few hours of research it doesn’t seem to be an usual use of the library so I came here to ask for help.
Is it possible to consume in the software some bits as if 2 more screens were connected only in line 1 and 3 ?
As I am currently developing my own HAT, is it simplyer to add some hardware shift register ?

For now I achieved to make them work by playing with chain length and rotation. But ideally I’d like to simply display a square image.

// Middle screen
sudo ./led-image-viewer full_0.png --led-rows=16 --led-cols=32 --led-chain=6 --led-parallel=3 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:-90;” --led-no-hardware-pulse -f --led-daemon
// Top screen
sudo ./led-image-viewer cube.gif --led-rows=16 --led-cols=32 --led-chain=2 --led-parallel=1 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:-90;” --led-no-hardware-pulse -f --led-daemon
// Bottom screen
sudo ./led-image-viewer cube.gif --led-rows=16 --led-cols=32 --led-chain=2 --led-parallel=3 --led-multiplexing=7 --led-brightness=25 --led-pixel-mapper=“V-mapper;Rotate:90;Mirror:H;Mi” --led-no-hardware-pulse -f --led-daemon

Thank you in advance for your help !

!!! EDIT !!!
I modified StoreInStream in led-image-viewer to add an offset when needed and it works !
It’s not clean and certainly not optimized but it works.
I’ll tried to add the offset in video-viewer tomorrow.

static void StoreInStream(const Magick::Image &img, int delay_time_us,
bool do_center,
rgb_matrix::FrameCanvas *scratch,
rgb_matrix::StreamWriter *output) {
scratch->Clear();
const int x_offset = do_center ? (scratch->width() - img.columns()) / 2 : 0;
const int y_offset = do_center ? (scratch->height() - img.rows()) / 2 : 0;
int y_cross_offset = 0;

for (size_t y = 0; y < img.rows(); ++y) {
for (size_t x = 0; x < img.columns(); ++x) {
if((y<=32) && ((x<32) || (x>=64))) y_cross_offset=32;
else y_cross_offset=0;
const Magick::Color &c = img.pixelColor(x, y+y_cross_offset);
if (c.alphaQuantum() < 256) {
scratch->SetPixel(x + x_offset, y + y_offset,
ScaleQuantumToChar(c.redQuantum()),
ScaleQuantumToChar(c.greenQuantum()),
ScaleQuantumToChar(c.blueQuantum()));
}
}
}
output->Stream(*scratch, delay_time_us);
}

1 Like