# Output Expander Feature Request: Partial Update

**URL:** <https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343>\
**Category:** Feature Ideas + Requests\
**Created:** [December 26, 2023, 7:41pm UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343 "2023-12-26T19:41:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LEDBob](https://forum.electromage.com/letter_avatar_proxy/v4/letter/l/278dde/32.png) [@LEDBob](https://forum.electromage.com/u/LEDBob)\
**Post date:** [December 26, 2023, 7:41pm UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343/1 "2023-12-26T19:41:27Z")

</div>

I am looking to use the Output Expander (OX) to drive multiple individual WS2812 LEDs and multiple WS2812 LED Strips inside studio scale models. Some of the LED effects include interior lighting, NAV lights, strobe lights, exterior flood lights, phaser and torpedoe lights, etc.

Looking at the Output Expander protocol and firmware, it appears that the only way to update a channel of LED pixels is to update the entire length of the channel. The OX code takes the data packet and copies the data straight into the specified channel’s internal pixel buffer starting at location 0. Furthermore, all pixel buffer values past the length of the data packet are set to 0.

In my case though, most LED pixel values are rarely changing. But let’s say I want to fire a torpedo. Then I currently would need to resend all the values in the channels LED pixels with only the one torpedo LED pixel value changing.

This certainly works great, but it would be nice if a partial update command was added to the OX protocol. The packet structure would pretty much remain the same with 1 additional field added to specify the pixel offset to start writing the channel’s pixel data. Plus the OX firmware would have to not overwrite the remaining pixels in the channel with 0s.

Does this all make sense?

---

<div class="post-metadata">

**Author:** ![sorceror](https://forum.electromage.com/user_avatar/forum.electromage.com/sorceror/32/735_2.png) [@sorceror](https://forum.electromage.com/u/sorceror)\
**Post date:** [December 26, 2023, 8:47pm UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343/2 "2023-12-26T20:47:09Z")

</div>

It makes sense, but the WS2812 protocol involves pushing all the pixels every frame, and I don’t imagine the OX has anywhere to store the current state of all the pixels, at least not when it’s driving a lot of pixels.

When I need a framebuffer, I just keep it in an array:

```javascript
var FB = array(pixelCount)
FB.mutate(()=>{return array(3)})

...

export function render(index) {
  Pixel = FB[index]
  rgb(Pixel[0], Pixel[1], Pixel[2])
}

```

---

<div class="post-metadata">

**Author:** ![LEDBob](https://forum.electromage.com/letter_avatar_proxy/v4/letter/l/278dde/32.png) [@LEDBob](https://forum.electromage.com/u/LEDBob)\
**Post date:** [December 27, 2023, 2:48am UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343/3 "2023-12-27T02:48:05Z")

</div>

Thanks for the response. Per the documentation (and confirmed in the firmware source code), the OX actually does store the complete state of all the pixels. It is single-buffered though, not double-buffered. That is why I was a little surprised that a command to modify just a section of the pixels was not already implemented. Seems like a great feature to add since the buffer in the OX is just sitting there to be taken advantage of.

---

<div class="post-metadata">

**Author:** ![sorceror](https://forum.electromage.com/user_avatar/forum.electromage.com/sorceror/32/735_2.png) [@sorceror](https://forum.electromage.com/u/sorceror)\
**Post date:** [December 27, 2023, 10:57am UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343/4 "2023-12-27T10:57:41Z")

</div>

> [@LEDBob](#):
>
> the OX actually does store the complete state of all the pixels

Wow, that’s cool! I think I have one still in bag around here somewhere … haven’t had a large enough project yet!

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [December 27, 2023, 3:54pm UTC](https://forum.electromage.com/t/output-expander-feature-request-partial-update/3343/5 "2023-12-27T15:54:12Z")

</div>

Should be possible, but doesn’t fit with the way Pixelblaze renders pixels so I haven’t added that kind of feature myself.

All the tools and data is there, would just need to add a command for the partial update.

There’s a tutorial post for getting the compile for the board working.

> [@Build your own Output Expander Firmware!](https://forum.electromage.com/t/build-your-own-output-expander-firmware/2468):
>
> It makes me a little uncomfortable, telling people, “go ye, change what code you will and flash then thine own firmware. Easy!”, when I haven’t done it myself. Even though I theoretically know how, I had never actually worked with the output expander’s firmware. So I’ve made a project based on @Wizard’s latest open source that builds alternate firmware for the Output Expander, and describes (here and in the README.MD) how I got there. (Note that this is not intended as a contest entry, just …
