Ledcar P10 16x16 multiplexers

I have written 2 multiplexer for 16x16 cards from LedCar.
V1 is for ‘old’ models
V2 is for the newest (Nov 2023)
The code to include in multiplex-mappers.cc

class LedCarMultiplexMapper : public MultiplexMapperBase {
public:
LedCarMultiplexMapper() : MultiplexMapperBase(“LedCar P10 16x16 V1”, 4) {}

void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
    unsigned char pos[64] = {
        0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20,
        0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
        0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x30,
        0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
    };
    *matrix_x = pos[x + ((y >> 1) % 4) * 16];
    *matrix_y = (y & 1) + (y >=8 ? 2 : 0);
}

};

class LedCar2MultiplexMapper : public MultiplexMapperBase {
public:
LedCar2MultiplexMapper() : MultiplexMapperBase(“LedCar P10 16x16 V2”, 4) {
}

void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
    unsigned char pos[64] = {
        6,4,2,0,22,20,18,16,38,36,34,32,54,52,50,48,
        7,5,3,1,23,21,19,17,39,37,35,33,55,53,51,49,
        8,10,12,14,24,26,28,30,40,42,44,46,56,58,60,62,
        9,11,13,15,25,27,29,31,41,43,45,47,57,59,61,63,
    };
    *matrix_x = pos[x + ((y >> 1) % 4) * 16];
    *matrix_y = (y & 1) + (y >=8 ? 2 : 0);
};

};

1 Like

thanks for posting, hopefully it will help others