-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ts
41 lines (41 loc) · 789 Bytes
/
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
input.onButtonPressed(Button.A, function () {
basic.showLeds(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`)
count += 1
reset = 0
basic.pause(100)
})
input.onButtonPressed(Button.AB, function () {
if (reset == 5) {
count = 0
basic.showString("" + (count))
} else {
reset += 1
basic.showString("" + (count))
}
})
input.onButtonPressed(Button.B, function () {
basic.showLeds(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`)
count += 1
reset = 0
basic.pause(100)
})
let reset = 0
let count = 0
count = 0
reset = 0
basic.forever(function () {
led.setBrightness(50)
basic.showIcon(IconNames.Heart)
})