-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
89 lines (68 loc) · 1.54 KB
/
main.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*- coding: utf-8 -*-
# @Time : 2022/4/14 15:26
# @Author : Kenny Zhou
# @FileName: main.py
# @Software: PyCharm
# @Email :[email protected]
import time
from ImgLoad import load_img
from ePaper import *
def led():
led = Pin(25, Pin.OUT)
while True:
led(1)
time.sleep(1)
led(0)
time.sleep(1)
def test():
# Portrait
epd = EPD_2in9_Portrait()
epd.Clear(0xff)
epd.fill(0xff)
epd.buffer = load_img()
epd.display(epd.buffer)
epd.delay_ms(2000)
epd.init()
epd = EPD_2in9_Portrait()
epd.Clear(0xff)
epd.fill(0xff)
epd.text("Token: 3", 32, 130, 0x00)
epd.display(epd.buffer)
epd.delay_ms(5000)
epd.init()
epd.Clear(0xff)
epd.delay_ms(2000)
print("sleep")
epd.sleep()
# epd = EPD_2in9_Landscape()
# epd.Clear(0xff)
#
# epd.fill(0xff)
#
# epd.display(load_img())
# epd.delay_ms(2000)
#
#
# for i in range(0, 10):
# epd.fill_rect(40, 270, 40, 10, 0xff)
# epd.text(str(i), 60, 270, 0x00)
# epd.display_Partial(epd.buffer)
epd.init()
epd.Clear(0xff)
epd.delay_ms(2000)
print("sleep")
epd.sleep()
# epd.sleep()
# epd.text("Kenny Zhou", 5, 10, 0x00)
# epd.text("Pico_ePaper-2.9", 5, 20, 0x00)
# epd.text("Raspberry Pico", 5, 30, 0x00)
# epd.display(epd.buffer)
# epd.delay_ms(2000)
if __name__ == "__main__":
# led = Pin(25, Pin.OUT)
# led.value(0)
# pass
led = Pin(25, Pin.OUT)
led.on()
test()
led.off()