replacing loops.pause -> pause, loops.forever -> forever

This commit is contained in:
Peli de Halleux
2018-02-14 16:05:31 -08:00
parent 0384eb4d9d
commit daa88b299d
62 changed files with 151 additions and 151 deletions

View File

@ -7,6 +7,6 @@ while (true) {
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
}
loops.pause(1);
pause(1);
}
```

View File

@ -8,6 +8,6 @@ while (true) {
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
}
loops.pause(1);
pause(1);
}
```

View File

@ -3,7 +3,7 @@
```blocks
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
brick.showImage(images.objectsLightOn)
loops.pause(5000)
pause(5000)
brick.clearScreen()
})
```

View File

@ -1,9 +1,9 @@
# Reverse Beeper Activity 1
```blocks
loops.forever(function () {
forever(function () {
music.playTone(440, sensors.ultrasonic4.distance());
loops.pause(50)
pause(50)
})
motors.largeBC.setSpeed(-20);
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear);

View File

@ -1,10 +1,10 @@
# Reverse Beeper Activity 2
```blocks
loops.forever(function () {
forever(function () {
if (motors.largeB.speed() != 0 && sensors.ultrasonic4.distance() < 20) {
music.playTone(440, sensors.ultrasonic4.distance());
loops.pause(50)
pause(50)
}
})
motors.largeBC.setSpeed(-20);

View File

@ -13,7 +13,7 @@ control.runInParallel(function () {
while (beep) {
if (sensors.ultrasonic4.distance() < 20) {
music.playTone(440, sensors.ultrasonic4.distance())
loops.pause(50)
pause(50)
}
}
})

View File

@ -5,10 +5,10 @@ brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
motors.largeBC.setSpeed(50)
sensors.touch1.pauseUntil(ButtonEvent.Pressed)
motors.largeBC.setSpeed(0)
loops.pause(1000)
pause(1000)
brick.setStatusLight(StatusLight.OrangeFlash)
motors.largeBC.setSpeed(-50)
loops.pause(2000)
pause(2000)
motors.largeBC.setSpeed(0)
})
```

View File

@ -6,10 +6,10 @@ brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
motors.largeBC.setSpeed(50)
sensors.touch2.pauseUntil(ButtonEvent.Pressed)
motors.largeBC.setSpeed(0)
loops.pause(1000)
pause(1000)
brick.setStatusLight(StatusLight.OrangeFlash)
motors.largeBC.setSpeed(-50)
loops.pause(2000)
pause(2000)
motors.largeBC.setSpeed(0)
})
```

View File

@ -9,11 +9,11 @@ brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
sensors.touch2.pauseUntil(ButtonEvent.Pressed)
brick.showImage(images.eyesTiredMiddle)
motors.largeBC.setSpeed(0)
loops.pause(1000)
pause(1000)
brick.setStatusLight(StatusLight.OrangeFlash)
brick.showImage(images.eyesDizzy)
motors.largeBC.setSpeed(-50)
loops.pause(2000)
pause(2000)
motors.largeBC.setSpeed(0)
})
```

View File

@ -15,7 +15,7 @@ brick.buttonDown.onEvent(ButtonEvent.Bumped, function () {
drive.push(5)
})
pauseUntil(() => drive.length >= 5)
loops.pause(1000)
pause(1000)
music.playSoundEffectUntilDone(sounds.communicationGo)
for (let d of drive) {
if (d == 1) {

View File

@ -19,7 +19,7 @@ brick.buttonDown.onEvent(ButtonEvent.Bumped, function () {
music.playSoundEffectUntilDone(sounds.systemClick)
})
brick.buttonEnter.pauseUntil(ButtonEvent.Bumped);
loops.pause(1000)
pause(1000)
music.playSoundEffectUntilDone(sounds.communicationGo)
for (let d of drive) {
if (d == 1) {

View File

@ -3,10 +3,10 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
motors.largeBC.tank(75, 30)
loops.pause(1500)
pause(1500)
motors.largeBC.tank(-30, -75)
loops.pause(1000)
pause(1000)
motors.largeBC.tank(50, 50)
loops.pause(3000)
pause(3000)
})
```

View File

@ -3,12 +3,12 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
motors.largeBC.tank(75, 30)
loops.pause(1500)
pause(1500)
motors.largeBC.tank(-30, -75)
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear);
motors.largeBC.tank(0, 0)
loops.pause(1000)
pause(1000)
motors.largeBC.tank(50, 50)
loops.pause(3000)
pause(3000)
})
```

View File

@ -3,13 +3,13 @@
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
motors.largeBC.tank(75, 30)
loops.pause(1500)
pause(1500)
motors.largeBC.tank(-30, -75)
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectNear);
motors.largeBC.tank(0, 0)
music.playSoundEffect(sounds.animalsDogBark1)
loops.pause(1000)
pause(1000)
motors.largeBC.tank(50, 50)
loops.pause(3000)
pause(3000)
})
```

View File

@ -1,7 +1,7 @@
# Traffic Lights Activity 3
```blocks
loops.forever(function () {
forever(function () {
if (sensors.color3.light(LightIntensityMode.Reflected) < 15) {
motors.largeBC.tank(30, 12)
} else {