Skip to content

Instantly share code, notes, and snippets.

@swilcox
Created March 9, 2025 17:10
Show Gist options
  • Save swilcox/10b569b7d3cfd318f160bca50a0fb3ce to your computer and use it in GitHub Desktop.
Save swilcox/10b569b7d3cfd318f160bca50a0fb3ce to your computer and use it in GitHub Desktop.
simple lcd display script
import sys
from tm1637 import TM1637Display
# Define the GPIO pins connected to the TM1637 display
CLK_PIN = 23 # GPIO23
DIO_PIN = 24 # GPIO24
def main(display_str=""):
# initialize the LCD display
lcd = TM1637Display(CLK_PIN, DIO_PIN, brightness=2)
# show the text
lcd.show_text(display_str)
if __name__ == "__main__":
if len(sys.argv) > 1: # if the program was run with an argument, use that!
main(sys.argv[1])
else:
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment