# P4 80x40 10S Panel

**URL:** <https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981>\
**Category:** Uncategorized\
**Created:** [January 12, 2025, 10:46am UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981 "2025-01-12T10:46:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kane.mcnamara](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/kane.mcnamara/32/436_2.png) [@kane.mcnamara](https://rpi-rgb-led-matrix.discourse.group/u/kane.mcnamara)\
**Post date:** [January 12, 2025, 10:46am UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/1 "2025-01-12T10:46:57Z")

</div>

I’ve been testing a panel from a manufacturer and it seems to have a weird layout of connection on the panel, segmented to blocks of 10px x 8px

 ![image](https://global.discourse-cdn.com/free1/uploads/rpi_rgb_led_matrix/original/1X/62a69a95e407a3a0a980030f56e808fd0fa86881.png)

How might I go about creating a pixel map for this?

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [January 12, 2025, 6:01pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/2 "2025-01-12T18:01:20Z")

</div>

follow the code for --led-row-addr-type=3 and see how it handles addressing in non standard ways.

---

<div class="post-metadata">

**Author:** ![kane.mcnamara](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/kane.mcnamara/32/436_2.png) [@kane.mcnamara](https://rpi-rgb-led-matrix.discourse.group/u/kane.mcnamara)\
**Post date:** [January 13, 2025, 10:40am UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/3 "2025-01-13T10:40:01Z")

</div>

So I based it off the pixel mapper as suggested and adjusted the tile height and width, every odd row has blocks where the pixels are reversed, any suggestion?

```auto
    class P4Outdoor80x40V2 : public MultiplexMapperBase
    {
    public:
      P4Outdoor80x40V2(const char *name, int even_vblock_offset, int odd_vblock_offset)
          : MultiplexMapperBase(name, 2),
            even_vblock_offset_(even_vblock_offset),
            odd_vblock_offset_(odd_vblock_offset) {}

      void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const
      {
        static const int tile_width = 8;
        static const int tile_height = 10;

        const int vert_block_is_odd = ((y / tile_height) % 2);

        const int even_vblock_shift = (1 - vert_block_is_odd) * even_vblock_offset_;
        const int odd_vblock_shitf = vert_block_is_odd * odd_vblock_offset_;

        *matrix_x = x + ((x + even_vblock_shift) / tile_width) * tile_width + odd_vblock_shitf;
        *matrix_y = (y % tile_height) + tile_height * (y / (tile_height * 2));
      }

    private:
      const int even_vblock_offset_;
      const int odd_vblock_offset_;
    };

```

 ![image](https://global.discourse-cdn.com/free1/uploads/rpi_rgb_led_matrix/original/1X/02380b3c720736439e69e9f11bb119c0b70ae9f4.jpeg)

---

<div class="post-metadata">

**Author:** ![kane.mcnamara](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/kane.mcnamara/32/436_2.png) [@kane.mcnamara](https://rpi-rgb-led-matrix.discourse.group/u/kane.mcnamara)\
**Post date:** [January 13, 2025, 11:16am UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/4 "2025-01-13T11:16:43Z")

</div>

I ended up writing an additional statement to just reverse the x pixels in blocks of 8, not too sure if its the best way of doing though

```auto
void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const
      {
        static const int tile_width = 8;
        static const int tile_height = 10;

        const int vert_block_is_odd = ((y / tile_height) % 2);

        const int even_vblock_shift = (1 - vert_block_is_odd) * even_vblock_offset_;
        const int odd_vblock_shitf = vert_block_is_odd * odd_vblock_offset_;

        if (!(vert_block_is_odd))
        {
          int block_count = (x)/tile_width;
          int pixel_num = (x) % tile_width-1;
          x = (block_count * tile_width) - 1 + (tile_width-1 - pixel_num);
        }

        *matrix_x = x + ((x + even_vblock_shift) / tile_width) * tile_width + odd_vblock_shitf;
        *matrix_y = (y % tile_height) + tile_height * (y / (tile_height * 2));
      }

```

---

<div class="post-metadata">

**Author:** ![board707](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@board707](https://rpi-rgb-led-matrix.discourse.group/u/board707)\
**Post date:** [January 13, 2025, 12:41pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/5 "2025-01-13T12:41:49Z")

</div>

> [@kane.mcnamara](#):
>
> it seems to have a weird layout of connection

Hello  
It is a quite typical pixel layout for i.e. “quarter scan” panels - panels that illuminate a four lines for every A B C address.  
The panel is divided into blocks with a repeating pixel layout. I call the width of such a block a “pixel base” (8pt in your case). The height of this block is equal to the scan of the panel.  
By breaking the whole pixel pattern into such blocks, we can significantly simplify the coordinate transformations for such panels.

See this for example:

> **[Add Quarter scan panel in 3 steps · mrcodetastic/ESP32-HUB75-MatrixPanel-DMA...](https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA/discussions/622)**
>
> I am goimg to show how I added support for my 1/4 scan panel to the library. It is a p10 32x16 1/4 scan matrix, and what is typical for 32x16 panels is that not only 4 lines are updated simultaneou...

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [January 14, 2025, 3:59pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/p4-80x40-10s-panel/981/6 "2025-01-14T15:59:34Z")

</div>

they are called zagzig panels and indeed have need special mapping that does not yet exist in this lib, but could be added by someone like you 🙂
