replacing loops.pause -> pause, loops.forever -> forever
This commit is contained in:
@ -7,6 +7,6 @@ while (true) {
|
||||
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
|
||||
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
|
||||
}
|
||||
loops.pause(1);
|
||||
pause(1);
|
||||
}
|
||||
```
|
||||
|
@ -8,6 +8,6 @@ while (true) {
|
||||
music.playSoundEffectUntilDone(sounds.mechanicalMotorStart)
|
||||
music.playSoundEffectUntilDone(sounds.mechanicalMotorIdle);
|
||||
}
|
||||
loops.pause(1);
|
||||
pause(1);
|
||||
}
|
||||
```
|
||||
|
@ -3,7 +3,7 @@
|
||||
```blocks
|
||||
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
|
||||
brick.showImage(images.objectsLightOn)
|
||||
loops.pause(5000)
|
||||
pause(5000)
|
||||
brick.clearScreen()
|
||||
})
|
||||
```
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -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)
|
||||
})
|
||||
```
|
@ -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)
|
||||
})
|
||||
```
|
@ -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)
|
||||
})
|
||||
```
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
})
|
||||
```
|
@ -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)
|
||||
})
|
||||
```
|
@ -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)
|
||||
})
|
||||
```
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user