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.
TM1640 Class Reference
A class for driving TM1640 LED controller. More...
#include <TM1640.h>
Inherited by TM1640_LM1640.
Public Types | |
| typedef char | DisplayData_t [TM1640_DISPLAY_MEM] |
| Datatype for displaydata. | |
Public Member Functions | |
| TM1640 (PinName mosi, PinName sclk) | |
| Constructor for class for driving TM1640 LED controller. | |
| void | cls () |
| Clear the screen and locate to 0. | |
| void | writeData (char data, int address) |
| Write databyte to TM1640. | |
| void | writeData (DisplayData_t data, int length=(TM1640_MAX_NR_GRIDS *TM1640_BYTES_PER_GRID), int address=0) |
| Write Display datablock to TM1640. | |
| void | setBrightness (char brightness=TM1640_BRT_DEF) |
| Set Brightness. | |
| void | setDisplay (bool on) |
| Set the Display mode On/off. | |
Detailed Description
A class for driving TM1640 LED controller.
Supports 16 Grids @ 8 Segments. Serial bus interface device.
Definition at line 105 of file TM1640.h.
Member Typedef Documentation
| typedef char DisplayData_t[TM1640_DISPLAY_MEM] |
Constructor & Destructor Documentation
| TM1640 | ( | PinName | mosi, |
| PinName | sclk | ||
| ) |
Constructor for class for driving TM1640 LED controller.
Constructor for class for driving TM1640 LED controller with Serial bus interface device.
Supports 16 Grids @ 8 segments. Serial bus interface device.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName sclk Serial bus SCLK pin
Supports 16 digits @ 8 segments.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName sclk Serial bus SCLK pin
Definition at line 31 of file TM1640.cpp.
Member Function Documentation
| void cls | ( | ) |
Clear the screen and locate to 0.
Definition at line 58 of file TM1640.cpp.
| void setBrightness | ( | char | brightness = TM1640_BRT_DEF ) |
Set Brightness.
- Parameters:
-
char brightness (3 significant bits, valid range 0..7 (1/16 .. 14/14 dutycycle)
- Returns:
- none
Definition at line 75 of file TM1640.cpp.
| void setDisplay | ( | bool | on ) |
| void writeData | ( | DisplayData_t | data, |
| int | length = (TM1640_MAX_NR_GRIDS * TM1640_BYTES_PER_GRID), |
||
| int | address = 0 |
||
| ) |
Write Display datablock to TM1640.
- Parameters:
-
DisplayData_t data Array of TM1640_DISPLAY_MEM (=16) bytes for displaydata length number bytes to write (valid range 0..(TM1640_MAX_NR_GRIDS * TM1640_BYTES_PER_GRID) (=16), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
Reimplemented in TM1640_LM1640.
Definition at line 119 of file TM1640.cpp.
| void writeData | ( | char | data, |
| int | address | ||
| ) |
Write databyte to TM1640.
- 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 TM1640_LM1640.
Definition at line 103 of file TM1640.cpp.
Generated on Wed Jul 13 2022 03:36:07 by
1.7.2
TM1640 LED controller (128 LEDs max).