-
Notifications
You must be signed in to change notification settings - Fork 169
Expand file tree
/
Copy pathLCD.py
More file actions
39 lines (37 loc) · 717 Bytes
/
Copy pathLCD.py
File metadata and controls
39 lines (37 loc) · 717 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
import PikaStdLib
import PikaStdDevice
lcd = PikaStdDevice.LCD()
lcd.init()
lcd.clear('white')
mem = PikaStdLib.MemChecker()
key = PikaStdDevice.KEY()
key.init()
time = PikaStdDevice.Time()
h = 10
w = 10
x = 10
y = 10
x_last = x
y_last = y
is_update = 0
print('mem used max:')
mem.max()
lcd.fill(x, y, w, h, 'blue')
while True:
key_val = key.get()
if key_val != -1:
x_last = x
y_last = y
is_update = 1
if key_val == 0:
x = x + 5
if key_val == 1:
y = y - 5
if key_val == 2:
y = y + 5
if key_val == 3:
x = x - 5
if is_update:
is_update = 0
lcd.fill(x_last, y_last, w, h, 'white')
lcd.fill(x, y, w, h, 'blue')