Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed_TM1637 TM1637_test
TM1637 Class Reference
A class for driving TM1637 LED controller. More...
#include <TM1637.h>
Inherited by TM1637_CATALEX, TM1637_EYEWINK, and TM1637_ROBOTDYN.
Public Types | |
| typedef char | DisplayData_t [TM1637_DISPLAY_MEM] |
| Datatype for displaydata. | |
| typedef char | KeyData_t |
| Datatypes for keymatrix data. | |
Public Member Functions | |
| TM1637 (PinName mosi_nc, PinName miso_dio, PinName sclk_clk) | |
| Constructor for class for driving TM1637 LED controller. | |
| TM1637 (PinName dio, PinName clk) | |
| Constructor for class for driving TM1637 LED controller. | |
| void | cls () |
| Clear the screen and locate to 0. | |
| void | writeData (char data, int address) |
| Write databyte to TM1637. | |
| void | writeData (DisplayData_t data, int length=(TM1637_MAX_NR_GRIDS *TM1637_BYTES_PER_GRID), int address=0) |
| Write Display datablock to TM1637. | |
| bool | getKeys (KeyData_t *keydata) |
| Read keydata block from TM1637. | |
| void | setBrightness (char brightness=TM1637_BRT_DEF) |
| Set Brightness. | |
| void | setDisplay (bool on) |
| Set the Display mode On/off. | |
Detailed Description
A class for driving TM1637 LED controller.
Supports 6 Grids @ 8 Segments and 16 Keys. Serial bus interface device.
Definition at line 157 of file TM1637.h.
Member Typedef Documentation
| typedef char DisplayData_t[TM1637_DISPLAY_MEM] |
Constructor & Destructor Documentation
| TM1637 | ( | PinName | mosi_nc, |
| PinName | miso_dio, | ||
| PinName | sclk_clk | ||
| ) |
Constructor for class for driving TM1637 LED controller.
Constructor for class for driving TM1637 LED controller with Serial bus interface device.
Supports 6 Grids @ 8 segments and 16 Keys. Serial bus interface device. DEPRECATED version
- Parameters:
-
PinName mosi_nc Serial bus NC pin PinName miso_dio Serial bus DIO pin PinName sclk_clk Serial bus CLK pin
Supports 6 Grids @ 8 segments. Also supports upto 16 Keys. Serial bus interface device. DEPRECATED version
- Parameters:
-
PinName mosi_nc Serial bus NC pin PinName miso_dio Serial bus DIO pin PinName sclk_clk Serial bus CLK pin
Definition at line 39 of file TM1637.cpp.
| TM1637 | ( | PinName | dio, |
| PinName | clk | ||
| ) |
Constructor for class for driving TM1637 LED controller.
Constructor for class for driving TM1637 LED controller with Serial bus interface device.
Supports 6 Grids @ 8 segments and 16 Keys. Serial bus interface device.
- Parameters:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Supports 6 digits @ 8 segments. Also supports upto 16 Keys.
- Parameters:
-
PinName dio Serial bus DIO pin PinName clk Serial bus CLK pin
Definition at line 50 of file TM1637.cpp.
Member Function Documentation
| void cls | ( | ) |
Clear the screen and locate to 0.
Definition at line 96 of file TM1637.cpp.
| bool getKeys | ( | KeyData_t * | keydata ) |
Read keydata block from TM1637.
- Parameters:
-
*keydata Ptr to bytes for keydata
- Returns:
- bool keypress True when at least one key was pressed
Definition at line 181 of file TM1637.cpp.
| void setBrightness | ( | char | brightness = TM1637_BRT_DEF ) |
Set Brightness.
- Parameters:
-
char brightness (3 significant bits, valid range 0..7 (1/16 .. 14/16 dutycycle)
- Returns:
- none
- Parameters:
-
char brightness (3 significant bits, valid range 0..7 (1/16 .. 14/14 dutycycle)
- Returns:
- none
Definition at line 113 of file TM1637.cpp.
| void setDisplay | ( | bool | on ) |
Set the Display mode On/off.
- Parameters:
-
bool display mode
Definition at line 124 of file TM1637.cpp.
| void writeData | ( | char | data, |
| int | address | ||
| ) |
Write databyte to TM1637.
- Parameters:
-
char data byte written at given address int address display memory location to write byte
- Returns:
- none
- Parameters:
-
int address display memory location to write byte char data byte written at given address
- Returns:
- none
Reimplemented in TM1637_CATALEX, TM1637_ROBOTDYN, and TM1637_EYEWINK.
Definition at line 141 of file TM1637.cpp.
| void writeData | ( | DisplayData_t | data, |
| int | length = (TM1637_MAX_NR_GRIDS * TM1637_BYTES_PER_GRID), |
||
| int | address = 0 |
||
| ) |
Write Display datablock to TM1637.
- Parameters:
-
DisplayData_t data Array of TM1637_DISPLAY_MEM (=6) bytes for displaydata length number bytes to write (valid range 0..(TM1637_MAX_NR_GRIDS * TM1637_BYTES_PER_GRID) (=6), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
- Parameters:
-
DisplayData_t data Array of TM1637_DISPLAY_MEM (=16) bytes for displaydata length number bytes to write (valid range 0..(TM1637_MAX_NR_GRIDS * TM1637_BYTES_PER_GRID) (=16), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
Reimplemented in TM1637_CATALEX, TM1637_ROBOTDYN, and TM1637_EYEWINK.
Definition at line 157 of file TM1637.cpp.
Generated on Wed Jul 13 2022 14:16:19 by
1.7.2
TM1637 LED controller (48 LEDs max), Keyboard scan (16 keys max)