tm1637_display

Driver for the TM1637 display.

  • Author(s): Neradoc

Implementation Notes

Software and Dependencies:

class tm1637_display.TM1637Display(clock: Pin, data: Pin, length: int = 4, digit_order: tuple = None, auto_write: bool = True, bit_delay: int = _DEFAULT_BIT_DELAY, brightness: int = 7, rotation: int = 0)

Numeric 7-segment display.

Parameters:
  • clock (microcontroller.Pin) – The clock pin.

  • data (microcontroller.Pin) – The data pin.

  • length (int) – The number of characters on the display.

  • digit_order (int) – The order of the digits on the display, if it doesn’t match the internal order of the chip. Reverse it for LTR.

  • auto_write (bool) – True if the display should immediately change when set. If False, show must be called explicitly.

  • bit_delay (int) – The (minimum) delay between bit twiddlings in us.

  • brightness (int) – The brightness, value from 0 to 7, False if off.

  • rotation (int) – Rotate the display 180 degrees with a value of 180, default 0.

property auto_write: bool

Auto write updates to the display.

property brightness

Brightness is a value between 0 and 7. Set to False to turn off.

clear()

Clear the display, nothing on it.

deinit()

Deinit. Free the pins.

print(value: int | float | str, decimal: int = 0)

Print the value to the display.

Parameters:
  • value (str|float|str) – The value to print

  • decimal (int) – The number of decimal places for a floating point number if decimal is greater than zero, or the input number is an integer if decimal is zero.

print_hex(value: int | float | str)

Print the value as a hexidecimal string to the display.

Parameters:

value (int|float|str) – The number to print

property rotation

Rotation is 0 or 180

set_segments(segments: bytes, pos=0)

Directly set the bit values of the segments

show()

Refresh the display and show the changes.

show_dots(dots: tuple)

Set the locations of dots on the display.