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())
|
||||
|
@ -81,7 +81,7 @@ function IS(t: number) {
|
||||
|
||||
function UP() {
|
||||
if (motors.largeA.angle() > -50) {
|
||||
control.runInBackground(function () {
|
||||
control.runInParallel(function () {
|
||||
motors.largeD.clearCounts()
|
||||
motors.largeD.setSpeed(-35);
|
||||
pauseUntil(() => motors.largeD.angle() < -25);
|
||||
|
Reference in New Issue
Block a user