-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.ts
43 lines (43 loc) · 1.08 KB
/
test.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
// tests go here; this will not be compiled when this package is used as an extension.
makerbit.onIrButton(IrButton.Any, IrButtonAction.Released, function () {
basic.showIcon(IconNames.SmallHeart)
})
makerbit.onIrButton(IrButton.Left, IrButtonAction.Pressed, function () {
basic.showLeds(`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`)
})
makerbit.onIrButton(IrButton.Down, IrButtonAction.Pressed, function () {
basic.showLeds(`
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .
`)
})
makerbit.onIrButton(IrButton.Up, IrButtonAction.Pressed, function () {
basic.showLeds(`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`)
})
makerbit.onIrButton(IrButton.Right, IrButtonAction.Pressed, function () {
basic.showLeds(`
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .
`)
})
makerbit.connectIrReceiver(DigitalPin.P8)
serial.redirectToUSB()
serial.setBaudRate(BaudRate.BaudRate115200)