-
Notifications
You must be signed in to change notification settings - Fork 384
Rewrite of mapping.md to make it easier to follow and more complete #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 translates to 65535 but any number above actual LED count will provide similar result - placeholder for skipped LED.
| ``` | ||
|
|
||
|
|
||
| ### Multi-line array, helpful in visualising 2D matrices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please substitute "ArduinoJSON" with "JSON parsing". Things have changed and ArduinoJSON is no longer responsible for ledmap handling.
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".