![]() 8 Digits, 8 LEDs, 8 keys |
![]() 8 Digits, 16 keys |
tm1638_init(mode)
with either TM1638_8 or TM1638_16 for the board you have.
tm1638_putc(char)
to send a single char
to the display or tm1638_puts(string)
to
send a string. For the decimal point, set bit-7 if you are sending
one char at a time. For strings, just put the decimal place where
you want it to appear.
tm1638_curs(position)
sets the cursor position (0-7).
tm1638_clear()
clears the display.
tm1638_bright(value)
sets the brightness (0-7).
tm1638_blink(rate)
sets the blink rate. The
rate is times 1/100 second, or 0 to disable.
tm1638_setled(led, on)
turns an LED on or off.
This is only available on the 8-key boards.
tm1638_push()
to push
display changes to the LEDs. The LEDs are not updated until this call.
tm1638_poll()
every
millisecond. This is easy when you use the millisecond callback
in my "lib_clock" library. Then periodically call
tm1638_getc()
to harvest key presses. Bit-7
will be low for a key press and high for release. You can use
this to create shift function keys. The key values
will be the ASCII characters "01234567" for the 8 key board
and ""0123456789ABCDEF" for the 16-key board. This is the default:
you can change this and set your own key map with tm1638_kmap()
.