-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.ts
More file actions
35 lines (31 loc) · 845 Bytes
/
Copy pathtest.ts
File metadata and controls
35 lines (31 loc) · 845 Bytes
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
// tests go here; this will not be compiled when this
// package is used as a library
input.onButtonPressed(Button.B, function () {
start = 0
Binbot.moveBinbot(0, 0, 0)
})
input.onButtonPressed(Button.A, function () {
start = 1
})
let start = 0
let sensor = 0
radio.setGroup(187)
basic.forever(function () {
if (start == 1) {
Binbot.moveBinbot(input.acceleration(Dimension.X), input.acceleration(Dimension.Y), 0)
} else {
Binbot.moveBinbot(0, 0, 0)
}
basic.pause(100)
})
basic.forever(function () {
for (let index = 0; index <= 8; index++) {
sensor = Binbot.requestSensor(index)
console.logValue("Sensor Value " + index.toString() + " : ", sensor)
if (sensor > 1000) {
start = 0
Binbot.moveBinbot(0, 0, 0)
}
}
basic.pause(100)
})