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

@ -16,7 +16,7 @@ Show the battery level percentage on the screen. Also, show a green light if the
```blocks
let battery = 0;
loops.forever(function() {
forever(function() {
brick.showString("Battery level:", 1)
brick.showNumber(battery, 2)
battery = brick.batteryLevel();
@ -28,6 +28,6 @@ loops.forever(function() {
} else {
brick.setStatusLight(StatusLight.RedPulse)
}
loops.pause(30000)
pause(30000)
})
```

View File

@ -32,7 +32,7 @@ Set the brick light to green when the `down` is pressed. When the button is not
```blocks
let isRed = false;
loops.forever(function() {
forever(function() {
if (brick.buttonLeft.isPressed()) {
brick.setStatusLight(StatusLight.Green);
isRed = false;

View File

@ -16,7 +16,7 @@ brick.showString("self-destruct in:", 2);
brick.showString("seconds", 5);
for (let i = 0; i < 10; i++) {
brick.showNumber(10 - i, 4);
loops.pause(1000);
pause(1000);
}
brick.clearScreen();
```

View File

@ -24,14 +24,14 @@ brick.setStatusLight(StatusLight.Red);
Repeatedly show a different color pattern for the brick light.
```blocks
loops.forever(function () {
forever(function () {
brick.setStatusLight(StatusLight.Orange)
loops.pause(1000)
pause(1000)
brick.setStatusLight(StatusLight.GreenFlash)
loops.pause(2000)
pause(2000)
brick.setStatusLight(StatusLight.RedPulse)
loops.pause(2000)
pause(2000)
brick.setStatusLight(StatusLight.Off)
loops.pause(500)
pause(500)
})
```