upgraded to run in parallel

This commit is contained in:
Peli de Halleux
2018-01-23 14:52:41 -08:00
parent 18480080e7
commit 387effbdd0
9 changed files with 14 additions and 14 deletions

View File

@ -3,13 +3,13 @@
```blocks
let beep = false
beep = true
control.runInBackground(function () {
control.runInParallel(function () {
motors.largeBC.setSpeed(-20)
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear)
motors.largeBC.stop()
beep = false
})
control.runInBackground(function () {
control.runInParallel(function () {
while (beep) {
if (sensors.ultrasonic4.distance() < 20) {
music.playTone(440, sensors.ultrasonic4.distance())