-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add a more configurable wordclock usermod #5838
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
Open
Raptor399
wants to merge
46
commits into
wled:main
Choose a base branch
from
Raptor399:word_clock_nl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
174f3fc
Add a more configurable wordclock usermod
Raptor399 007426b
wordclock: Fix review remark "Handle unavailable or rejected clipboar…
Raptor399 d47152b
wordclock: Fix review comment "Store the word strings in static flash…
Raptor399 5586a6b
wordclock: Fix review comment "Carry the hour when the 5-minute round…
Raptor399 c268ed0
wordclock: Fix review comment "Fix the out-of-bounds `ledMask` write …
Raptor399 cec7904
wordclock: Fix review comment "Make `ledOffset` configurable, or remo…
Raptor399 7987322
wordclock: Fix review comment "Use one `ledMask` allocation path and …
Raptor399 e7e0f0a
wordclock: Fix review comment "Export the matrix in the format the us…
Raptor399 ed0aed9
wordclock: Freeze the existing usermod's German reference behavior
Raptor399 f1fc351
wordclock: Extract neutral types and helpers
Raptor399 f0b6504
wordclock: Implement the German compatibility pack
Raptor399 946a8c2
wordclock: Extract Dutch language logic
Raptor399 12c0492
wordclock: Added comments to separate matrix representation if needed…
Raptor399 08849f8
wordclock: Use minute markers in Dutch code
Raptor399 2069a33
wordclock: Improve function documentation
Raptor399 115fdce
wordclock: Document possible future `placePlan()` changes
Raptor399 b93f111
wordclock: Update the matrix generator and helper documentation
Raptor399 61f7108
wordclock: Replace the old usermod
Raptor399 3b7e89e
wordclock: Correct test findings
Raptor399 9418dd7
wordclock: Fix review comment "Pass a RAM pointer as the first `strnc…
Raptor399 fd56946
wordclock: Fix review comment "The German placement API has no matrix…
Raptor399 38ad209
wordclock: Fix review comment "Convert marker positions in `updateMin…
Raptor399 73dfd3d
wordclock: Fix review comment "Use fenced `ini` block for the Platfor…
Raptor399 53c94ef
wordclock: Fix review comment "Correct the migration documentation"
Raptor399 9793528
wordclock: Fix review comment "The phrase cache key changes every min…
Raptor399 94eef46
wordclock: Fix review comment "The 7-character prefix strip removes r…
Raptor399 f74dcec
wordclock: Fix review comment "Clamp `ledOffset` like the other confi…
Raptor399 8514626
wordclock: Fix review comment "The white channel is discarded"
Raptor399 b182284
wordclock: Fix review comment "Make the German quarter-hour dialect c…
Raptor399 8f57392
wordclock: Fix review comment "Clamp `width` when the language changes"
Raptor399 765b48d
Merge branch 'main' into word_clock_nl
softhack007 2a968e9
wordclock: Fix review comment "Keep the unmarked phrase key stable ac…
Raptor399 6e22bac
wordclock: Fix review comment "Use tabs for indentation in the modifi…
Raptor399 2e1896a
wordclock: Add short statement about markers
Raptor399 17109f8
wordclock: Fix review comment "Remove the unsupported `Word Clock NL`…
Raptor399 c2f00c6
wordclock: Fix review comment "Reject matrices shorter than the longe…
Raptor399 2f40b23
wordclock: Fix review comment "Set the document language to English"
Raptor399 c257f2e
wordclock: Fix review comment "add `platformio_override.sample.ini`"
Raptor399 6a92683
wordclock: Fix review comment "Rename the sample to the CI-discoverab…
Raptor399 8d76297
Merge branch 'main' into word_clock_nl
softhack007 1e3a3fa
wordclock: Fix review comment "remove or uncomment Mac/Linux ports"
Raptor399 67b6910
Fix review comment "Validate `ledOffset` against the strip address ra…
Raptor399 0829f51
Fix review comment "Commit the display mask only after placement succ…
Raptor399 aa940b2
Fix review comment "Align the generator with the firmware’s byte-orie…
Raptor399 04ace1f
Fix review comment "Align exact-hour German highlights with WordClock…
Raptor399 6951989
Fix review comment "Highlight only `EIN` at exactly one o'clock"
Raptor399 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "name": "usermod_v2_word_clock_nl", | ||
| "build": { "libArchive": false } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Word Clock NL Usermod V2 | ||
|
|
||
| This usermod turns a grid of LEDs into a Dutch word clock. Each LED sits behind | ||
| one letter in a matrix of seemingly random characters. The letters form words | ||
| that can be lit to show the current time. Here is an example 12x12 matrix: | ||
|
|
||
| NEUEHETHETHT | ||
| NFEYIEISISVT | ||
| VIJFKWARTNAA | ||
| AGBETIENOAEE | ||
| AINOVERVOORA | ||
| TFUHALFIEENY | ||
| OEHIBUZEVENV | ||
| NBNMTWEEELFN | ||
| DRIEVIERVIJF | ||
| NEGENZESTIEN | ||
| TWAALFACHTNT | ||
| BXNHWEUUROAD | ||
|
|
||
| The matrix contains hidden words that can be combined into Dutch sentences | ||
| describing the time in five-minute steps, such as "HET IS TIEN OVER HALF | ||
| ZEVEN". The usermod brightens the letters needed for the current sentence and | ||
| darkens the other letters. | ||
|
|
||
| This is what the same 12x12 matrix would look like at 6:40: | ||
|
|
||
| .......HET.. | ||
| ......IS.... | ||
| ............ | ||
| ....TIEN.... | ||
| ...OVER..... | ||
| ...HALF..... | ||
| ......ZEVEN. | ||
| ............ | ||
| ............ | ||
| ............ | ||
| ............ | ||
| ............ | ||
|
|
||
| The usermod does not choose the LED colors. WLED continues to control the | ||
| colors and effects; this usermod only changes their brightness based on the | ||
| time. | ||
|
|
||
| These settings control the word clock: | ||
|
|
||
| * `Active`: turn the word clock on or off. | ||
| * `Brightness Active`: brightness of the letters used for the current time. Use 0 for off and 255 for full brightness. | ||
| * `Brightness Inactive`: brightness of the other letters. Use 0 for off and 255 for full brightness. | ||
| * `Meander`: set to `false` when the LED strip runs left to right on every row. Set to `true` when each row alternates direction. | ||
| * `Character Matrix`: the uppercase letters in your clock face. Include all the words needed to display the Dutch time sentences, with each row placed directly after the previous row. | ||
| * `Character Matrix Width`: the number of letters in each row. It cannot be greater than the total number of letters or smaller than the longest word the clock needs to display. | ||
| * `Matrix Char Offset`: the number of letters to skip at the beginning of the matrix when matching letters to LEDs. This is useful when the first physical LEDs do not correspond to the first letters. | ||
| * `Test Hour`: the hour to display for testing, from 0 to 23. Set it to -1 to use the real time. | ||
| * `Test Minute`: the minute to display for testing, from 0 to 59. | ||
|
|
||
| Words are highlighted only when they are found and fit completely within one | ||
| matrix row. The clock rounds the current time to the nearest five minutes. | ||
|
|
||
|
|
||
| ## Installation | ||
|
|
||
| 1. Copy `platformio_override.sample.ini` from the main WLED folder to | ||
| `platformio_override.ini`. Update the board and serial port settings to | ||
| match your hardware. For example: | ||
|
|
||
| [platformio] | ||
| default_envs = wordclock_nl | ||
|
|
||
| [env:wordclock_nl] | ||
| extends = env:esp32dev | ||
| # Use `ls /dev/cu.*` to find the correct port for your connected board | ||
| upload_port = /dev/cu.wchusbserial123 | ||
| upload_speed = 921600 | ||
| monitor_port = /dev/cu.wchusbserial123 | ||
| monitor_speed = 115200 | ||
| custom_usermods = ${env:esp32dev.custom_usermods} usermod_v2_word_clock_nl | ||
|
|
||
| 2. Make sure `USERMOD_ID_WORDCLOCK_NL` is defined in `wled00/const.h`. | ||
|
|
||
| 3. Build WLED and upload it to your controller: | ||
|
|
||
| npm run build | ||
| pio run -e wordclock_nl --target upload | ||
|
|
||
| 4. Open WLED and activate the usermod at Config > Usermods > Word Clock NL. | ||
|
|
||
|
|
||
| ## Customization | ||
|
|
||
| This usermod is designed for Dutch and uses the character matrix from the | ||
| usermod settings. To create a custom matrix, open | ||
| `woordklok-matrix-generator.html`. When the matrix is ready, click | ||
| "KOPIEER TEXT" and paste the result into `Character Matrix` in | ||
| WLED > Config > Usermods > Word Clock NL. Remove all line breaks, and set | ||
| `Character Matrix Width` to the number of columns in each row. | ||
|
|
||
| Using a language other than Dutch requires changes to the code that creates and | ||
| matches time sentences in both `woordklok-matrix-generator.html` and | ||
| `usermod_v2_word_clock_nl.cpp`. This is an advanced customization. Test the | ||
| result thoroughly with the HTML generator so that every supported time is | ||
| displayed correctly. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.