-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
42 lines (42 loc) · 1.42 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
bitcommander.onEvent(BCPins.Green, BCEvents.Up, function () {
radio.sendValue("Green", 0)
})
bitcommander.onEvent(BCPins.Yellow, BCEvents.Down, function () {
radio.sendValue("Yellow", 1)
})
bitcommander.onEvent(BCPins.Joystick, BCEvents.Up, function () {
radio.sendValue("Joystick", 0)
})
bitcommander.onEvent(BCPins.Blue, BCEvents.Down, function () {
radio.sendValue("Blue", 1)
})
bitcommander.onEvent(BCPins.Green, BCEvents.Down, function () {
radio.sendValue("Green", 1)
})
bitcommander.onEvent(BCPins.Yellow, BCEvents.Up, function () {
radio.sendValue("Yellow", 0)
})
bitcommander.onEvent(BCPins.Joystick, BCEvents.Down, function () {
radio.sendValue("Joystick", 1)
})
bitcommander.onEvent(BCPins.Red, BCEvents.Down, function () {
radio.sendValue("Red", 1)
})
bitcommander.onEvent(BCPins.Red, BCEvents.Up, function () {
radio.sendValue("Red", 0)
})
bitcommander.onEvent(BCPins.Blue, BCEvents.Up, function () {
radio.sendValue("Blue", 0)
})
radio.setGroup(1)
bitcommander.ledRainbow()
radio.sendValue("cal_x", bitcommander.readJoystick(BCJoystick.X))
radio.sendValue("cal_y", bitcommander.readJoystick(BCJoystick.Y))
basic.showIcon(IconNames.Heart)
basic.pause(500)
bitcommander.ledClear()
basic.forever(function () {
radio.sendValue("x", bitcommander.readJoystick(BCJoystick.X))
radio.sendValue("y", bitcommander.readJoystick(BCJoystick.Y))
radio.sendValue("Dial", bitcommander.readDial())
})