-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
26 lines (26 loc) · 960 Bytes
/
Copy pathmain.ts
File metadata and controls
26 lines (26 loc) · 960 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
bluetooth.onBluetoothConnected(function () {
basic.showString("c")
})
bluetooth.onBluetoothDisconnected(function () {
basic.showString("d")
})
blockytalky.onReceivedString(function (key, receivedString) {
if (receivedString == "avant") {
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 100)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 100)
}
if (receivedString == "droite") {
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 100)
}
if (receivedString == "gauche") {
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 100)
}
if (receivedString == "arriere") {
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CCW, 100)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CCW, 100)
}
if (receivedString == "stop") {
maqueen.MotorRun(maqueen.aMotors.M1, maqueen.Dir.CW, 0)
maqueen.MotorRun(maqueen.aMotors.M2, maqueen.Dir.CW, 0)
}
})