TM1637 Class
- ID: tm1637
- Name: 7-segment Display
- Other Names: Grove 4-Digit Display
- Category: display
- Manufacturer: seeed
- Link: http://wiki.seeed.cc/Grove-4-Digit_Display/
- Connection: gpio
TM1637 is a display controller for LED-based 7-segment displays. It can be used to address and write data to multiple display digits. This driver is based on the Grove version of the TM1637 display that uses 4 digits, thus making it ideal for clock displays, timers, counters, or even score displays in a two-player arcade game.
Methods
TM1637
-
clk_pin
-
dio_pin
-
bright
TM1637 constructor
Parameters:
-
clk_pin
NumberClock pin the sensor is connected to
-
dio_pin
NumberData pin the sensor is connected to
-
bright
NumberInitial brightness, from 0 (dark) to 7 (bright) (default is 3)
Returns:
write
-
digits
Writes digits to the display in a 7-segment encoding
Parameters:
-
digits
Uint8_t *Array of digits to send to the display
Returns:
0 if successful, error code otherwise
write
-
d
-
arguments
Writes digits to the display in a 7-segment encoding
Parameters:
-
d
NumberList of multiple arguments to send to the display
-
arguments
...undefined
Returns:
0 if successful, error code otherwise
writeAt
-
index
-
symbol
Writes a symbol (digit or letter) to the display in a specified index
Parameters:
-
index
Number0-based index of the digit to change from the left
-
symbol
StringDigit or letter to display
Returns:
0 if successful, error code otherwise
write
-
digits
Writes all the digits or letters to the display as a string
Parameters:
-
digits
StringString of symbols to display
Returns:
0 if successful, error code otherwise
setColon
-
value
Toggles the colon between digits on the display
Parameters:
-
value
BooleanTrue to turn the colon on, false to turn it off
setBrightness
-
value
Controls the brightness of the display
Parameters:
-
value
NumberBrightness, from 0 (darkest) to 7 (brightest)