upgraded to run in parallel
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user