The HT162X Digits Display Class.
More...
#include <ht162x_digits.h>
Inherits Print.
|
| Ht162xDigits (LcdType lcdType, uint8_t csPin, uint8_t wrPin, uint8_t dataPin, uint8_t lcdBacklightPin=-1, uint8_t pwmIndexEsp32=-1) |
|
void | begin () |
|
void | setPowerSave (bool powersave) |
|
void | setIntensity (uint8_t intensity) |
|
void | setTestMode (bool testmode) |
|
void | setCursor (int16_t x, int16_t y) |
|
void | setCursorX (int16_t x) |
|
void | setCursorY (int16_t y) |
|
void | setTextWrap (bool w) |
|
void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint8_t pattern=B00000000) |
|
bool | printFormatted (int16_t x, int16_t y, int16_t w, int16_t align, String content) |
|
void | write () |
|
virtual void | fillScreen (uint8_t pattern) |
|
int16_t | width () const |
|
int16_t | height () const |
|
bool | getTextWrap () const |
|
int16_t | getCursorX () const |
|
int16_t | getCursorY () const |
|
uint8_t | getCharLen (unsigned char c, bool firstChar=false) |
|
The HT162X Digits Display Class.
This class derived from Print
class provides an implementation of a 7/16 segment digits display.
◆ Ht162xDigits()
ustd::Ht162xDigits::Ht162xDigits |
( |
LcdType |
lcdType, |
|
|
uint8_t |
csPin, |
|
|
uint8_t |
wrPin, |
|
|
uint8_t |
dataPin, |
|
|
uint8_t |
lcdBacklightPin = -1 , |
|
|
uint8_t |
pwmIndexEsp32 = -1 |
|
) |
| |
|
inline |
Instantiates a DisplayDigitsHT162x mupplet
No hardware interaction is performed, until begin() is called.
- Parameters
-
name | Name of the lcd display, used to reference it by pub/sub messages |
lcdType | LcdType |
◆ begin()
void ustd::Ht162xDigits::begin |
( |
| ) |
|
|
inline |
◆ fillRect()
void ustd::Ht162xDigits::fillRect |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
h, |
|
|
uint8_t |
pattern = B00000000 |
|
) |
| |
|
inline |
Fill a rectangle completely with one pattern.
- Parameters
-
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in digit positions |
h | Height in digit positions |
pattern | Pattern to fill the area with |
◆ fillScreen()
virtual void ustd::Ht162xDigits::fillScreen |
( |
uint8_t |
pattern | ) |
|
|
inlinevirtual |
Empty the frame buffer
- Parameters
-
pattern | Binary (on or off) pattern to fill with |
◆ getCharLen()
uint8_t ustd::Ht162xDigits::getCharLen |
( |
unsigned char |
c, |
|
|
bool |
firstChar = false |
|
) |
| |
|
inline |
Calculates the length in digits of a char
- Parameters
-
c | The ASCII character in question |
firstChar | Set to true, if this is the first chat of a sequence (default: false) |
◆ getCursorX()
int16_t ustd::Ht162xDigits::getCursorX |
( |
| ) |
const |
|
inline |
Get text cursor X location
- Returns
- X coordinate in digit positions
◆ getCursorY()
int16_t ustd::Ht162xDigits::getCursorY |
( |
| ) |
const |
|
inline |
Get text cursor Y location
- Returns
- Y coordinate in digit positions
◆ getTextWrap()
bool ustd::Ht162xDigits::getTextWrap |
( |
| ) |
const |
|
inline |
Returns if too long text will be wrapped to the next line
- Returns
- Wrapping mode
◆ height()
int16_t ustd::Ht162xDigits::height |
( |
| ) |
const |
|
inline |
Get height of the display
- Returns
- Height in number of rows
◆ printFormatted()
bool ustd::Ht162xDigits::printFormatted |
( |
int16_t |
x, |
|
|
int16_t |
y, |
|
|
int16_t |
w, |
|
|
int16_t |
align, |
|
|
String |
content |
|
) |
| |
|
inline |
Prints a text at a specified location with a specified formatting
This method prints a text at the specified location with the specified length using left, right or centered alignment. All parameters are checked for plasibility and will be adapted to the current display size.
- Parameters
-
x | Top left corner x coordinate |
y | Top left corner y coordinate |
w | Width in digit positions |
align | Alignment of the string to display: 0 = left, 1 = center, 2 = right |
content | The string to print |
- Returns
true
if the string fits the defined space, false
if output was truncated
◆ setCursor()
void ustd::Ht162xDigits::setCursor |
( |
int16_t |
x, |
|
|
int16_t |
y |
|
) |
| |
|
inline |
Set text cursor location
- Parameters
-
x | X coordinate in digit positions |
y | Y coordinate in digit positions |
◆ setCursorX()
void ustd::Ht162xDigits::setCursorX |
( |
int16_t |
x | ) |
|
|
inline |
Set text cursor X location
- Parameters
-
x | X coordinate in digit positions |
◆ setCursorY()
void ustd::Ht162xDigits::setCursorY |
( |
int16_t |
y | ) |
|
|
inline |
Set text cursor Y location
- Parameters
-
y | Y coordinate in digit positions |
◆ setIntensity()
void ustd::Ht162xDigits::setIntensity |
( |
uint8_t |
intensity | ) |
|
|
inline |
Set the brightness of the display
- Parameters
-
intensity | The brightness of the display. (0..15) |
◆ setPowerSave()
void ustd::Ht162xDigits::setPowerSave |
( |
bool |
powersave | ) |
|
|
inline |
Set the power saving mode for the display
- Parameters
-
powersave | If true the display goes into power-down mode. Set to false for normal operation. |
◆ setTestMode()
void ustd::Ht162xDigits::setTestMode |
( |
bool |
testmode | ) |
|
|
inline |
Set the test mode for the display
- Parameters
-
testmode | If true the display goes into test mode. Set to false for normal operation. |
◆ setTextWrap()
void ustd::Ht162xDigits::setTextWrap |
( |
bool |
w | ) |
|
|
inline |
Set whether text that is too long for the screen width should automatically wrap around to the next line (else clip right).
- Parameters
-
w | true for wrapping, false for clipping |
◆ width()
int16_t ustd::Ht162xDigits::width |
( |
| ) |
const |
|
inline |
Get width of the display
- Returns
- Width in number of digits
◆ write()
void ustd::Ht162xDigits::write |
( |
| ) |
|
|
inline |
Flushes the frame buffer to the display
In order to implement flicker free double buffering, no display function has any immediate effect on the display. All display operations are buffered into a frame buffer. By calling this method, the current content of the frame buffer is displayed.
The documentation for this class was generated from the following file: