Adafruit LED Backpack Library
|
Class for 7-segment numeric displays. More...
#include <Adafruit_LEDBackpack.h>
Public Member Functions | |
Adafruit_7segment (void) | |
Constructor for 7-segment numeric displays. | |
size_t | write (char c) |
Issue single character to display. More... | |
size_t | write (const char *buffer, size_t size) |
Write characters from buffer to display. More... | |
void | print (char c) |
Print byte-size numeric value to 7-segment display. More... | |
void | print (unsigned char b, int base=RAW_BITS) |
Print unsigned byte-size numeric value to 7-segment display. More... | |
void | print (int n, int base=DEC) |
Print integer value to 7-segment display. More... | |
void | print (unsigned int n, int base=DEC) |
Print unsigned integer value to 7-segment display. More... | |
void | print (long n, int base=DEC) |
Print long integer value to 7-segment display. More... | |
void | print (unsigned long n, int base=DEC) |
Print unsigned long integer value to 7-segment display. More... | |
void | print (double n, int digits=2) |
Print double-precision float value to 7-segment display. More... | |
void | print (const String &c) |
Print from a String object to 7-segment display. More... | |
void | print (const char c[]) |
Print from a C-style string array to 7-segment display. More... | |
void | println (char c) |
Print byte-size numeric value w/newline to 7-segment display. More... | |
void | println (unsigned char b, int base=RAW_BITS) |
Print unsigned byte-size numeric value w/newline to 7-segment display. More... | |
void | println (int n, int base=DEC) |
Print integer value with newline to 7-segment display. More... | |
void | println (unsigned int n, int base=DEC) |
Print unsigned integer value with newline to 7-segment display. More... | |
void | println (long n, int base=DEC) |
Print long integer value with newline to 7-segment display. More... | |
void | println (unsigned long n, int base=DEC) |
Print unsigned long integer value w/newline to 7-segment display. More... | |
void | println (double n, int digits=2) |
Print double-precision float value to 7-segment display. More... | |
void | println (const String &c) |
Print from a String object w/newline to 7-segment display. More... | |
void | println (const char c[]) |
Print from a C-style string array w/newline to 7-segment display. More... | |
void | println (void) |
Print newline to 7-segment display (rewind position to start). | |
void | writeDigitRaw (uint8_t x, uint8_t bitmask) |
Write raw segment bits into display buffer. More... | |
void | writeDigitNum (uint8_t x, uint8_t num, bool dot=false) |
Set specific digit # to a numeric value. More... | |
void | writeDigitAscii (uint8_t x, uint8_t c, bool dot=false) |
Set specific digit # to a character value. More... | |
void | drawColon (bool state) |
Set or unset colon segment. More... | |
void | printNumber (long n, uint8_t base=2) |
General integer-printing function used by some of the print() variants. More... | |
void | printFloat (double n, uint8_t fracDigits=2, uint8_t base=DEC) |
General float-printing function used by some of the print() variants. More... | |
void | printError (void) |
Light display segments in an error-indicating configuration. | |
void | writeColon (void) |
Issue colon-on directly to display (bypass buffer). | |
Public Member Functions inherited from Adafruit_LEDBackpack | |
Adafruit_LEDBackpack (void) | |
Constructor for HT16K33 devices. | |
bool | begin (uint8_t _addr=0x70, TwoWire *theWire=&Wire) |
Start I2C and initialize display state (blink off, full brightness). More... | |
void | setDisplayState (bool state) |
Turn display on or off. More... | |
void | setBrightness (uint8_t b) |
Set display brightness. More... | |
void | blinkRate (uint8_t b) |
Set display blink rate. More... | |
void | writeDisplay (void) |
Issue buffered data in RAM to display. | |
void | clear (void) |
Clear display. | |
Additional Inherited Members | |
Public Attributes inherited from Adafruit_LEDBackpack | |
uint16_t | displaybuffer [8] |
Raw display data. | |
Protected Attributes inherited from Adafruit_LEDBackpack | |
Adafruit_I2CDevice * | i2c_dev = NULL |
Pointer to I2C bus interface. | |
Class for 7-segment numeric displays.
size_t Adafruit_7segment::write | ( | char | c | ) |
Issue single character to display.
c | Character to write (ASCII character, not numeric). |
size_t Adafruit_7segment::write | ( | const char * | buffer, |
size_t | size | ||
) |
Write characters from buffer to display.
buffer | Character array to write |
size | Number of characters to write |
void Adafruit_7segment::print | ( | char | c | ) |
Print byte-size numeric value to 7-segment display.
c | Numeric value. |
void Adafruit_7segment::print | ( | unsigned char | b, |
int | base = RAW_BITS |
||
) |
Print unsigned byte-size numeric value to 7-segment display.
b | Numeric value. |
base | Number base (default = RAW_BITS = raw bits) |
void Adafruit_7segment::print | ( | int | n, |
int | base = DEC |
||
) |
Print integer value to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::print | ( | unsigned int | n, |
int | base = DEC |
||
) |
Print unsigned integer value to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::print | ( | long | n, |
int | base = DEC |
||
) |
Print long integer value to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::print | ( | unsigned long | n, |
int | base = DEC |
||
) |
Print unsigned long integer value to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::print | ( | double | n, |
int | digits = 2 |
||
) |
Print double-precision float value to 7-segment display.
n | Numeric value. |
digits | Fractional-part digits. |
void Adafruit_7segment::print | ( | const String & | c | ) |
Print from a String object to 7-segment display.
c | String object, passed by reference. |
void Adafruit_7segment::print | ( | const char | c[] | ) |
Print from a C-style string array to 7-segment display.
c | Array of characters. |
void Adafruit_7segment::println | ( | char | c | ) |
Print byte-size numeric value w/newline to 7-segment display.
c | Numeric value. |
void Adafruit_7segment::println | ( | unsigned char | b, |
int | base = RAW_BITS |
||
) |
Print unsigned byte-size numeric value w/newline to 7-segment display.
b | Numeric value. |
base | Number base (default = RAW_BITS = raw bits) |
void Adafruit_7segment::println | ( | int | n, |
int | base = DEC |
||
) |
Print integer value with newline to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::println | ( | unsigned int | n, |
int | base = DEC |
||
) |
Print unsigned integer value with newline to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::println | ( | long | n, |
int | base = DEC |
||
) |
Print long integer value with newline to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::println | ( | unsigned long | n, |
int | base = DEC |
||
) |
Print unsigned long integer value w/newline to 7-segment display.
n | Numeric value. |
base | Number base (default = DEC = base 10) |
void Adafruit_7segment::println | ( | double | n, |
int | digits = 2 |
||
) |
Print double-precision float value to 7-segment display.
n | Numeric value. |
digits | Fractional-part digits. |
void Adafruit_7segment::println | ( | const String & | c | ) |
Print from a String object w/newline to 7-segment display.
c | String object, passed by reference. |
void Adafruit_7segment::println | ( | const char | c[] | ) |
Print from a C-style string array w/newline to 7-segment display.
c | Array of characters. |
void Adafruit_7segment::writeDigitRaw | ( | uint8_t | x, |
uint8_t | bitmask | ||
) |
Write raw segment bits into display buffer.
x | Character position (0-3). |
bitmask | Segment bits. |
void Adafruit_7segment::writeDigitNum | ( | uint8_t | x, |
uint8_t | num, | ||
bool | dot = false |
||
) |
Set specific digit # to a numeric value.
x | Character position. |
num | Numeric (not ASCII) value. |
dot | If true, light corresponding decimal. |
void Adafruit_7segment::writeDigitAscii | ( | uint8_t | x, |
uint8_t | c, | ||
bool | dot = false |
||
) |
Set specific digit # to a character value.
x | Character position. |
c | Character (ASCII). |
dot | If true, light corresponding decimal. |
void Adafruit_7segment::drawColon | ( | bool | state | ) |
Set or unset colon segment.
state | 'true' to enable colon, 'false' for off. |
void Adafruit_7segment::printNumber | ( | long | n, |
uint8_t | base = 2 |
||
) |
General integer-printing function used by some of the print() variants.
n | Numeric value. |
base | Base (2 = binary). |
void Adafruit_7segment::printFloat | ( | double | n, |
uint8_t | fracDigits = 2 , |
||
uint8_t | base = DEC |
||
) |
General float-printing function used by some of the print() variants.
n | Numeric value. |
fracDigits | Fractional-part digits. |
base | Base (default DEC = base 10). |