GPIO-driven TM1637 segment display. Call setBrightness() before the first update. Buffered brightness is applied on the next setSegments() or number display operation.
More...
#include <TM1637Display.hpp>
|
| void | setBrightness (uint8_t brightness, bool on=true) |
| | Cache display brightness and enable state.
|
| void | setSegments (const uint8_t segments[], uint8_t length=4, uint8_t pos=0) |
| | Send raw segment bytes to the display.
|
| void | showNumberDec (int num, bool leading_zero=false, uint8_t length=4, uint8_t pos=0) |
| | Display a signed decimal number.
|
| void | showNumberDecEx (int num, uint8_t dots=0, bool leading_zero=false, uint8_t length=4, uint8_t pos=0) |
| | Display a signed decimal number with decimal-point/colon bits.
|
|
uint8_t | encodeDigit (uint8_t digit) |
| | Return the seven-segment bitmap for the low nibble of digit (hexadecimal 0-F).
|
| | TM1637Display (uint8_t pinClk, uint8_t pinDIO) |
| | Bind clock/data pins, configure released inputs, and clear output latches.
|
|
|
void | bitDelay () |
|
void | start () |
|
void | stop () |
|
bool | writeByte (uint8_t b) |
GPIO-driven TM1637 segment display. Call setBrightness() before the first update. Buffered brightness is applied on the next setSegments() or number display operation.
◆ TM1637Display()
| TM1637Display::TM1637Display |
( |
uint8_t | pinClk, |
|
|
uint8_t | pinDIO ) |
Bind clock/data pins, configure released inputs, and clear output latches.
- Parameters
-
| pinClk | Clock GPIO. |
| pinDIO | Bidirectional data GPIO. |
◆ setBrightness()
| void TM1637Display::setBrightness |
( |
uint8_t | brightness, |
|
|
bool | on = true ) |
Cache display brightness and enable state.
- Parameters
-
| brightness | Brightness level 0 through 7 (only low three bits are used). |
| on | True enables the display; false switches it off on the next update. |
◆ setSegments()
| void TM1637Display::setSegments |
( |
const uint8_t | segments[], |
|
|
uint8_t | length = 4, |
|
|
uint8_t | pos = 0 ) |
Send raw segment bytes to the display.
- Parameters
-
| segments | Segment bitmap array, one byte per digit. |
| length | Number of bytes to read from segments. |
| pos | Starting digit position; caller must keep the range within the display. |
◆ showNumberDec()
| void TM1637Display::showNumberDec |
( |
int | num, |
|
|
bool | leading_zero = false, |
|
|
uint8_t | length = 4, |
|
|
uint8_t | pos = 0 ) |
Display a signed decimal number.
- Parameters
-
| num | Number to format. |
| leading_zero | Pad with zeros instead of blanks. |
| length | Digit field width, 1 through 4. |
| pos | Starting digit position within the four-digit display. |
◆ showNumberDecEx()
| void TM1637Display::showNumberDecEx |
( |
int | num, |
|
|
uint8_t | dots = 0, |
|
|
bool | leading_zero = false, |
|
|
uint8_t | length = 4, |
|
|
uint8_t | pos = 0 ) |
Display a signed decimal number with decimal-point/colon bits.
- Parameters
-
| num | Number to format. |
| dots | Dot mask; bits 7 through 4 correspond to the four displayed digits. |
| leading_zero | Pad with zeros instead of blanks. |
| length | Digit field width, 1 through 4. |
| pos | Starting digit position; keep pos + length at most 4. |
The documentation for this class was generated from the following file: