import tm1637 # Import TM1637 display module
from machine import Pin
from utime import sleep
# Set up the TM1637 display with clock (clk) and data (dio) pins
mydisplay = tm1637.TM1637(clk=Pin(0), dio=Pin(1))
# print numbers from 0 to 7 and set brightness
for x in range(8):
mydisplay.brightness(7) # Set brightness to max
print(x) # Print the number
sleep(1) # Pause for 1 second
while True:
mydisplay.show("TYIT") # Display "TYIT"
sleep(2) # Wait for 2 seconds
mydisplay.show(" ") # Clear display
sleep(1) # Wait for 1 second
mydisplay.scroll("Sushant Gupta") # Scroll "Sushant Gupta"
sleep(2) # Wait for 2 seconds
mydisplay.number(91) # Display number 91
sleep(1) # Wait for 1 second
mydisplay.temperature(31) # Show temperature 31°C
sleep(1) # Wait for 1 second