WLEDwiki/Mapping.md

1.3 KiB

WLED now has the ability to remap your LED strip programmatically.

What is it?

This allows us to treat the WLED strip as if it is wired in any way - we can then use the mapping feature to address the strip in any order. This allows for matrix support, serpentine runs and such.

How do we do it?

Navigate to the edit page for your WLED device by adding /edit to its' address - for example, https://my-led-device.local/edit/ Use this edit page to create a file called ledmap.json

ledmap.json needs to be a JSON formatted file with the the key being "map" and the value being an array of numbers representing the new order of pixels.

The ArduinoJSON library is extremely whitespace sensitive. If your ledmap.json is not working, check for whitespaces where they should not be.

Examples

In the below example (formatted multiple ways), we remap a strip of four LEDs from a physical order of 1 2 3 4 into a new order of 1 3 2 4.

{"map":[1,3,2,4]}

{"map":[
1,3,2,4
]}

{"map":[
1,3,
2,4
]}

This is another example that switches direction every 5 LEDs. It could be formatted any of the three ways demonstrated above.

{"map":[0, 1, 2, 3, 4, 9, 8, 7, 6, 5, 10, 11, 12, 13, 14, 19, 18, 17, 16, 15, 20, 21, 22, 23, 24, 29, 28, 27, 26, 25]}