TM1638_plus 2.1.0
Arduino library for Tm1638 modules
|
Class for Model 2. More...
#include <TM1638plus_Model2.h>
Public Member Functions | |
TM1638plus_Model2 (uint8_t strobe, uint8_t clock, uint8_t data, bool swap_nibbles=false, bool high_freq=false) | |
Constructor for class TM1638plus_Model2. | |
uint8_t | ReadKey16 (void) |
Read push buttons method ( one of two methods available) | |
uint16_t | ReadKey16Two (void) |
Read push buttons method ( one of two methods available) | |
void | DisplaySegments (uint8_t segment, uint8_t segmentValue) |
Send seven segment value to display. | |
void | DisplayHexNum (uint16_t numberUpper, uint16_t numberLower, uint8_t dots, boolean leadingZeros=true, AlignTextType_e=TMAlignTextLeft) |
Display an Hexadecimal number in each nibble (4 digits on display) | |
void | DisplayDecNum (unsigned long number, uint8_t dots, boolean leadingZeros=true, AlignTextType_e=TMAlignTextLeft) |
Display an decimal number. | |
void | DisplayStr (const char *string, const uint16_t dots=0) |
Display a string, with decimal point display. | |
void | ASCIItoSegment (const uint8_t values[]) |
Takes in Array of 8 ASCII bytes , Called from DisplayStr . Scans each ASCII byte converts to array of 8 segment bytes where each byte represents a segment. Then calls DisplaySegments() method to display segments on display. | |
void | DisplayDecNumNibble (uint16_t numberUpper, uint16_t numberLower, uint8_t dots, boolean leadingZeros=true, AlignTextType_e=TMAlignTextLeft) |
Display an integer in each nibble (4 digits on display) | |
![]() | |
void | displayBegin () |
Begin method , sets pin modes and activate display. | |
void | reset (void) |
Reset / clear the display. | |
void | brightness (uint8_t brightness) |
Sets the brightness level of segments in display on a scale of brightness. | |
uint8_t | getHFIN_DELAY () const |
void | setHFIN_DELAY (uint8_t delay) |
uint8_t | getHFOUT_DELAY () const |
void | setHFOUT_DELAY (uint8_t delay) |
Additional Inherited Members | |
![]() | |
enum | DecimalPoint_e : uint8_t { DecPointOff = 0 , DecPointOn = 1 } |
Switch on or off decimal point on a digit. More... | |
![]() | |
bool | displaylib_LED_debug = false |
![]() | |
static constexpr uint16_t | displaylib_LED_VersionNum = 210 |
![]() | |
uint8_t | HighFreqshiftin (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) |
Shifts in a byte of data from the Tm1638 SPI-like bus. | |
void | HighFreqshiftOut (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) |
Shifts out a byte of data on to the Tm1638 SPI-like bus. | |
void | sendCommand (uint8_t value) |
Send command to display. | |
void | sendData (uint8_t data) |
Send Data to display. | |
![]() | |
static const uint8_t * | pFontSevenSegptr () |
Retrieves a pointer to the seven-segment font data table. | |
![]() | |
uint8_t | _STROBE_IO |
uint8_t | _DATA_IO |
uint8_t | _CLOCK_IO |
bool | _HIGH_FREQ = false |
uint8_t | _HFIN_DELAY = 1 |
uint8_t | _HFOUT_DELAY = 1 |
![]() | |
static constexpr uint8_t | TM_ACTIVATE = 0x8F |
static constexpr uint8_t | TM_BUTTONS_MODE = 0x42 |
static constexpr uint8_t | TM_WRITE_LOC = 0x44 |
static constexpr uint8_t | TM_WRITE_INC = 0x40 |
static constexpr uint8_t | TM_SEG_ADR = 0xC0 |
static constexpr uint8_t | TM_LEDS_ADR = 0xC1 |
static constexpr uint8_t | TM_BRIGHT_ADR = 0x88 |
static constexpr uint8_t | TM_BRIGHT_MASK = 0x07 |
static constexpr uint8_t | TM_DEFAULT_BRIGHTNESS = 0x02 |
static constexpr uint8_t | TM_DISPLAY_SIZE = 8 |
![]() | |
static constexpr uint8_t | _ASCII_FONT_OFFSET = 0x20 |
static constexpr uint8_t | _ASCII_FONT_END = 0x7B |
static constexpr uint8_t | _ASCII_FONT_HEX_OFFSET = 0x10 |
static constexpr uint8_t | DEC_POINT_7_MASK = 0x80 |
Class for Model 2.
TM1638plus_Model2::TM1638plus_Model2 | ( | uint8_t | strobe, |
uint8_t | clock, | ||
uint8_t | data, | ||
bool | swap_nibbles = false , |
||
bool | high_freq = false |
||
) |
Constructor for class TM1638plus_Model2.
strobe | GPIO STB pin |
clock | GPIO CLK pin |
data | GPIO DIO pin |
swap_nibbles | default false, if true, swaps nibbles on display byte. |
high_freq | Changes the value of parameter _HIGH_FREQ which is default false. |
void TM1638plus_Model2::ASCIItoSegment | ( | const uint8_t | values[] | ) |
Takes in Array of 8 ASCII bytes , Called from DisplayStr . Scans each ASCII byte converts to array of 8 segment bytes where each byte represents a segment. Then calls DisplaySegments() method to display segments on display.
values | An array of 8 ASCII bytes |
void TM1638plus_Model2::DisplayDecNum | ( | unsigned long | number, |
uint8_t | dots, | ||
boolean | leadingZeros = true , |
||
AlignTextType_e | TextAlignment = TMAlignTextLeft |
||
) |
Display an decimal number.
number | integer to display 2^32. |
dots | Decimal point display, switch's on decimal point for those positions. |
leadingZeros | leading zeros set, true on , false off. |
TextAlignment | left or right text alignment on display. |
void TM1638plus_Model2::DisplayDecNumNibble | ( | uint16_t | numberUpper, |
uint16_t | numberLower, | ||
uint8_t | dots, | ||
boolean | leadingZeros = true , |
||
AlignTextType_e | TextAlignment = TMAlignTextLeft |
||
) |
Display an integer in each nibble (4 digits on display)
numberUpper | upper nibble integer 2^16 |
numberLower | lower nibble integer 2^16 |
dots | Turn on or off decimal points to 0xFF d7d6d5d4d3d2d1d0 |
leadingZeros | leading zeros set, true on , false off |
TextAlignment | left or right text alignment on display |
void TM1638plus_Model2::DisplayHexNum | ( | uint16_t | numberUpper, |
uint16_t | numberLower, | ||
uint8_t | dots, | ||
boolean | leadingZeros = true , |
||
AlignTextType_e | TextAlignment = TMAlignTextLeft |
||
) |
Display an Hexadecimal number in each nibble (4 digits on display)
numberUpper | upper nibble integer 2^16 |
numberLower | lower nibble integer 2^16 |
dots | Decimal point display, switch's on decimal point for those positions. 0 to 0xFF |
leadingZeros | leading zeros set, true on , false off |
TextAlignment | left or right text alignment on display |
void TM1638plus_Model2::DisplaySegments | ( | uint8_t | segment, |
uint8_t | digit | ||
) |
Send seven segment value to display.
segment | 0-7 byte of data corresponding to segments abcdefg(dp) 01234567. |
digit | display digit position, 0x00 to 0xFF d8d7d6d5d54d3d2d1. |
void TM1638plus_Model2::DisplayStr | ( | const char * | string, |
const uint16_t | dots = 0 |
||
) |
Display a string, with decimal point display.
string | pointer to char array |
dots | Turn on or off decimal points 0 to 0xFF d7d6d5d4d3d2d1d0 |
unsigned char TM1638plus_Model2::ReadKey16 | ( | void | ) |
Read push buttons method ( one of two methods available)
uint16_t TM1638plus_Model2::ReadKey16Two | ( | void | ) |
Read push buttons method ( one of two methods available)