display4.py
837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import tm1637
from machine import Pin
from utime import sleep
display4 = tm1637.TM1637(clk=Pin(12), dio=Pin(13))
# --------------------------------------------------- #
# FUNCTIONS
# --------------------------------------------------- #
def work_tm1637(data:str):
display4.show(data)
sleep(2)
mydisplay.show(' ')
# # Show a word
# mydisplay.show("Pico")
# sleep(1)
# #blank the screen
# mydisplay.show(" ")
# sleep(1)
# #show numbers
# mydisplay.number(-123)
# sleep(1)
# #show a time with colon
# mydisplay.numbers(12,59)
# sleep(1)
# #adjust the brightness to make it lower
# mydisplay.brightness(0)
# sleep(1)
# #show scrolling text
# mydisplay.scroll("Hello World 123", delay=200)
# sleep(1)
# #show temperature
# mydisplay.temperature(99)
# sleep(1)
# #blank the screen again
# mydisplay.show(" ")