Here's an image showing the physical layout of my LEDs. I have a total of 154 lights, numbered here from 0-153. Pixel 0 is near my right hip, and the lights move in a vertical serpentine pattern out to the front edge, then over the shoulder through the connector, winding up and down and across the rest of the panels.
This layout doesn't work out to a nice clean rectangle, or this job would be much easier. My strip also doesn't start in one of the corners, but rather somewhere in the middle, so a normal 2d matrix layout isn't going to work here.
WLED has a solution: an LED map file.
An LED map is simply a list of pixel numbers entered in whatever order is desired to make 2d animations look good, with the ability to add placeholder "dummy" pixels for the blank spots in the matrix. This matrix has blank spots in the arm holes, above the short sections of LED strip, which can be filled in with a dummy pixel (numbered -1) so the matrix comes out rectangular.
WLED has options for serpentine or standard layout, and can start from any of the four corners. For simplicity, I'm using a standard (non-serpentine) layout starting in the upper left corner.
Here is the map file made from the layout above:
{"map":[ 153,134,133,-1,-1,102,101,82,81,62,61,42,-1,-1,21,22,41, 152,135,132,-1,-1,103,100,83,80,63,60,43,-1,-1,20,23,40, 151,136,131,-1,-1,104,99,84,79,64,59,44,-1,-1,19,24,39, 150,137,130,-1,-1,105,98,85,78,65,58,45,-1,-1,18,25,38, 149,138,129,118,117,106,97,86,77,66,57,46,5,6,17,26,37, 148,139,128,119,116,107,96,87,76,67,56,47,4,7,16,27,36, 147,140,127,120,115,108,95,88,75,68,55,48,3,8,15,28,35, 146,141,126,121,114,109,94,89,74,69,54,49,2,9,14,29,34, 145,142,125,122,113,110,93,90,73,70,53,50,1,10,13,30,33, 144,143,123,123,112,111,92,91,72,71,52,51,0,11,12,31,32]}
There are 10 rows and 17 columns of pixels, and I've added a -1 in any of the blank spaces where I want a dummy pixel so the columns line up right.
Take note of the formatting: there are no spaces anywhere in the file. Carriage returns are fine, but spaces will throw WLED off.
This is harder than it looks. It's very easy to skip a number or mistype part of the list. Check and double-check your map for errors!
To upload your map, go to your WLED url and add "/edit" to the end: i.e. http://envested.local/edit You'll find an edit window for .json files. Click "Create" and call the file ledmap.json. Paste in the text of your map and click "Save".
Next, head back to the LED Settings page. Click 2d Configuration and select 2d Matrix from the dropdown.
Set up your matrix to match the layout of your map. Mine has 17 columns and 10 rows, starting in the upper left corner.
Don't upload your ledmap.json file in the "gap file" dropdown. A gap file and an ledmap are different.
How do you know if it worked? Select the Chase effect with a color gradient palette. The lights will come on starting with the first LED in the map. If the lights in the upper left corner come on first and then scroll through like a book, your map is correct. Congratulations!
If your physical LED 0 is still the first one that lights up, or if the lights come on in a strange or unexpected order, weird colors, or lights get skipped, your map needs to be edited - you may have missed a number or gotten them in the wrong order.
If your map seems right but the lights are still defaulting to the physical LED strip layout, another thing you can try is to create a second LED map in the "edit" screen. Call it ledmap1.json, save and reboot.
When there is more than one map to choose from, a dropdown appears in the "segments" screen so you can select your map from a list. This was helpful as I was troubleshooting - my coat wouldn't pick up the LED map at first, but I could change it here.
You can create as many different maps as you'd like and choose which one to use for each of your animations and segments.
Once the mapping features are working, check this box on the "effects" page to filter for all the 2d effects in WLED. Try them out. Many effects have control sliders you can use to tune the animation, and some allow you to choose color palettes as well. The full range of 1d animations work too, but the 2d animations are where WLED really shines for this type of build.
Page last edited August 02, 2024
Text editor powered by tinymce.