Created
March 9, 2025 17:10
-
-
Save swilcox/10b569b7d3cfd318f160bca50a0fb3ce to your computer and use it in GitHub Desktop.
simple lcd display script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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