-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
52 lines (51 loc) · 1.31 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
def bounce():
global x
for i in range(141):
x = i + (radius + 1)
LCD1IN8.draw_circle(x - 1,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.WHITE),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1)
LCD1IN8.draw_circle(x,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.RED),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1)
LCD1IN8.LCD_DisplayWindows(x - 1 - (radius + 1), y - 1 - radius, x + radius, y + radius)
for j in range(141):
l = 140 - j
x = l + (radius + 1)
LCD1IN8.draw_circle(x + 1,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.WHITE),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1)
LCD1IN8.draw_circle(x,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.RED),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1)
LCD1IN8.LCD_DisplayWindows(x - radius - 1, y - 1 - radius, x + 1 + radius, y + radius)
def setup():
global l, k, radius, y
LCD1IN8.LCD_Init()
LCD1IN8.LCD_Clear()
LCD1IN8.LCD_SetBL(123)
l = 0
k = 0
radius = 10
y = 64
k = 0
l = 0
y = 0
radius = 0
x = 0
setup()
def on_forever():
bounce()
basic.forever(on_forever)