-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
72 lines (72 loc) · 1.41 KB
/
main.ts
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
function bounce () {
let l: number;
for (let i = 0; i <= 140; i++) {
x = i + (radius + 1)
LCD1IN8.DrawCircle(
x - 1,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.WHITE),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1
)
LCD1IN8.DrawCircle(
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 (let j = 0; j <= 140; j++) {
l = 140 - j
x = l + (radius + 1)
LCD1IN8.DrawCircle(
x + 1,
y,
radius,
LCD1IN8.Get_Color(LCD_COLOR.WHITE),
DRAW_FILL.DRAW_FULL,
DOT_PIXEL.DOT_PIXEL_1
)
LCD1IN8.DrawCircle(
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
)
}
}
function setup () {
LCD1IN8.LCD_Init()
LCD1IN8.LCD_Clear()
LCD1IN8.LCD_SetBL(123)
m = 0
k = 0
radius = 10
y = 64
}
let k = 0
let m = 0
let y = 0
let radius = 0
let x = 0
setup()
basic.forever(function () {
bounce()
})