View Source TM1638 (tm1638 v0.1.0)
Link to this section Summary
Functions
Clear the display Turn off every led
Example: TM1638.display_segment(tm,1, "") -> set the i-th 7-segment display (and all the following, according to the length of value1) all the 7-segment displays after the #i are filled by the characters in value1 this could be one-character string (so 7-segment #i is set to that character) or a longer string, and the following 7-segment displays are modified accordingly
Displays text starting from the correct position
Receive the bytes_count from the board
Get the data buttons the four octets read on rpi ver B it takes around 16ms to get the whole 4 bits
Set single led to on or off the leds are on the bit 0 of the odd addresses (led_0 on address 1, led_1 on address 3)
Set Leds values accepts an integer in range 0..255 and sets all leds according to the bits in integer
Send a byte (STROBE must be Low)
Send a command
Send a data at address
Set the data modes :param wr_mode: read_mode (read the key scan) or write_mode (write data) :param addr_mode: incr_addr (automatic address increased) or fixed_addr
Turn off (physically) the leds
Turn on the display and set the brightness The pulse width used is set to
Link to this section Types
Link to this section Functions
Clear the display Turn off every led
Example: TM1638.display_segment(tm,1, "") -> set the i-th 7-segment display (and all the following, according to the length of value1) all the 7-segment displays after the #i are filled by the characters in value1 this could be one-character string (so 7-segment #i is set to that character) or a longer string, and the following 7-segment displays are modified accordingly
@spec display_text(t(), String.t(), integer()) :: t()
@spec display_text(t(), [String.t()], integer()) :: t()
Displays text starting from the correct position
Receive the bytes_count from the board
Get the data buttons the four octets read on rpi ver B it takes around 16ms to get the whole 4 bits
Set single led to on or off the leds are on the bit 0 of the odd addresses (led_0 on address 1, led_1 on address 3)
Set Leds values accepts an integer in range 0..255 and sets all leds according to the bits in integer
Send a byte (STROBE must be Low)
Sending a bit from a byte consists of setting the STROBE to low Then setting to CLOCK to low, sending the bit via dio and setting the clock back to HIGH..
Send a command
Send a data at address
Set the data modes :param wr_mode: read_mode (read the key scan) or write_mode (write data) :param addr_mode: incr_addr (automatic address increased) or fixed_addr
Turn off (physically) the leds
Turn on the display and set the brightness The pulse width used is set to:
0 => 1/16 1 => 2/16 2 => 4/16 3 => 10/16 4 => 11/16 5 => 12/16 6 => 13/16 7 => 14/16