-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add set_buffer to tm1637 #6021
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
Add set_buffer to tm1637 #6021
Changes from all commits
03113cc
71099ef
43ff629
ac68a93
25674d3
5f1d660
957efe6
8ff4166
9e834d3
32c8cfc
d6fafb0
40dbe79
7630248
2b8f1dc
e5da904
f029cca
c22d14c
daa0ef2
15803de
f2d6ab7
df77fb6
c180fe0
aecfd56
f6d85eb
7c95e5a
554b872
460d745
4f6998e
3de0e43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -122,6 +122,8 @@ | |||
| Please see [Formatted Text](/components/display#display-printf) for a quick introduction into the `printf` formatting rules and | ||||
| [Displaying Time](/components/display#display-strftime) for an introduction into the `strftime` time formatting. | ||||
|
|
||||
|
|
||||
|
|
||||
|
Comment on lines
+125
to
+126
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove extra blank lines to satisfy lint. Lint reports multiple consecutive blank lines here. Collapse to a single blank line. 🔧 Proposed fix-
-📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: Lint[failure] 126-126: [failure] 125-125: 🤖 Prompt for AI Agents |
||||
| ### Creating a digital clock | ||||
|
|
||||
| The following example creates a typical digital clock with the `:` colon flashing every second. | ||||
|
|
@@ -179,6 +181,22 @@ | |||
|
|
||||
| {{< img src="tm1637_3plus_devices.png" alt="Image" caption="Three TM1637 displays on 3 control lines" width="50.0%" class="align-center" >}} | ||||
|
|
||||
| ### Raw segment buffer | ||||
|
|
||||
| If you already have segment bitmasks, you can write raw bytes to the display buffer using `set_buffer`. This bypasses | ||||
| character conversion and is useful for custom glyphs or animations. | ||||
|
|
||||
| The TM1637 uses a single byte per digit; the decimal point is bit 7 (0x80). | ||||
|
|
||||
| ```yaml | ||||
| display: | ||||
| - platform: tm1637 | ||||
| # ... | ||||
| lambda: |- | ||||
| // Raw segment values for "0123" with the dot on the last digit | ||||
| it.set_buffer(0x3f, 0x06, 0x5b, 0x4f | 0x80, 0x00, 0x00); | ||||
| ``` | ||||
|
Comment on lines
+191
to
+198
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find tm1637-related source files
find . -type f \( -name "*tm1637*" -o -name "*TM1637*" \) | head -20Repository: esphome/esphome-docs Length of output: 361 🏁 Script executed: # Search for set_buffer method definition in cpp/h files
rg -l 'set_buffer' --type=cppRepository: esphome/esphome-docs Length of output: 212 🏁 Script executed: # Look for TM1637 class/component definition
rg 'class.*TM1637' --type=cpp -A 10Repository: esphome/esphome-docs Length of output: 212 🏁 Script executed: # Read the tm1637.md file to see the full context
wc -l ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 106 🏁 Script executed: # Read the section around lines 191-198 to get more context
sed -n '170,220p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 1227 🏁 Script executed: # Search for "set_buffer" in the documentation
rg -n 'set_buffer' ./content/components/display/tm1637.md -B5 -A5Repository: esphome/esphome-docs Length of output: 825 🏁 Script executed: # Search for "buffer" references to understand sizing
rg -n -i 'buffer' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 280 🏁 Script executed: # Check what's in the See Also section and look for API references
sed -n '200,204p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 252 🏁 Script executed: # Search for any other mentions of buffer or configuration examples
rg -n 'lambda' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 504 🏁 Script executed: # Look for configuration documentation that might mention display dimensions
rg -n -i 'digit\|config\|buffer' ./content/components/display/tm1637.md | head -20Repository: esphome/esphome-docs Length of output: 46 🏁 Script executed: # Read the first part of the file to understand configuration structure
sed -n '1,100p' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 4765 🏁 Script executed: # Look for all lambda examples to see if there's a pattern
rg -n 'it\.' ./content/components/display/tm1637.mdRepository: esphome/esphome-docs Length of output: 596 Clarify The example passes 6 bytes (the TM1637 hardware buffer size supporting up to 6 digits), but this isn't explained. Readers seeing a 4-digit 🤖 Prompt for AI Agents |
||||
|
|
||||
| ## See Also | ||||
|
|
||||
| - {{< docref "index/" >}} | ||||
|
|
||||
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.
There are two consecutive empty lines here before the “Creating a digital clock” heading. Please remove the extra blank lines to keep spacing consistent with the rest of the document.