Rewrite of mapping.md to make it easier to follow and more complete#291
Rewrite of mapping.md to make it easier to follow and more complete#291azariah001 wants to merge 1 commit intowled:mainfrom
Conversation
Adjusted and added more section headings to aid in finding specific information. Expanded most sections with additional examples and specific callouts for config breaking issues, like not including a number in the filename and common file formatting issues. Also added a new section about the previously undocumented custom naming key "n".
blazoncek
left a comment
There was a problem hiding this comment.
Thank you for contribution.
Unfortunately there are several incorrect and misleading bits. Please revise.
| Use this edit page to create a file called `ledmap.json`. | ||
| Use this edit page to create a file called `ledmap1.json`, where `1` is incremented for each map you load on your controller. | ||
|
|
||
| **Note:** If the filename is `ledmap.json`, the config file ***will not load***; the filename must end in a number even if there's only one config file. |
There was a problem hiding this comment.
That is untrue. ledmap.json is a default ledmap, loaded at boot or when "Default" is selected.
| The ArduinoJSON library is *****extremely***** white-space sensitive. | ||
| If your `ledmap.json` file is not working, check for white-spaces where they should not be. The LED positions are zero-indexed. | ||
| The ArduinoJSON library is *****extremely***** whitespace sensitive. | ||
| If your `ledmap1.json` file is not working, check for white-spaces where they should not be. |
There was a problem hiding this comment.
The best way is to minimize ledmap file and pass it through JSON parser 1st.
| ## Complicated maps | ||
|
|
||
| Use -1 in the map for gaps/blank/null LEDs. | ||
| LEDs can be mapped in the "map" array in any order, including out-of-order, allowing you to map custom and complex shapes using `-1` in the map for gaps/blank/null LEDs. In addition, not all LEDs in a segment need to be mapped in the map; you can leave out extra LEDs if they're not required. |
There was a problem hiding this comment.
-1 translates to 65535 but any number above actual LED count will provide similar result - placeholder for skipped LED.
There was a problem hiding this comment.
for sake of "keep it simple", I think we can still tell users that "-1" is the best way.
| ``` | ||
|
|
||
|
|
||
| ### Multi-line array, helpful in visualising 2D matrices |
There was a problem hiding this comment.
2D ledmap requires "width" and "height" keys. If omitted, the resulting ledmap is 1D and WLED will refuse to provide 2D support. Please include that info if you are suggesting to split lines for 2D.
| {"n": "Double infinity map.", | ||
| "map": | ||
| [ | ||
| -1, -1, 14, -1, 12, -1, 10, -1, -1, |
There was a problem hiding this comment.
In the preceding lines there was a warning about spaces and in this example, there are plenty of spaces present. Please avoid contradicting information.
|
|
||
| The ArduinoJSON library is *****extremely***** white-space sensitive. | ||
| If your `ledmap.json` file is not working, check for white-spaces where they should not be. The LED positions are zero-indexed. | ||
| The ArduinoJSON library is *****extremely***** whitespace sensitive. |
There was a problem hiding this comment.
Please substitute "ArduinoJSON" with "JSON parsing". Things have changed and ArduinoJSON is no longer responsible for ledmap handling.
|
Is this PR complementary to PR #293 ? Or is it about the same documentation parts? |
Adjusted and added more section headings to aid in finding specific information.
Expanded most sections with additional examples and specific callouts for config breaking issues, like not including a number in the filename and common file formatting issues.
Also added a new section about the previously undocumented custom naming key "n".