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

@ -18,7 +18,7 @@ When the brick is in motion, it moves in the direction of one of axes used to me
Flash the status light to red if the roll rate of `gyro 2` is more that `30` degrees per second.
```blocks
loops.forever(function () {
forever(function () {
if (sensors.gyro2.rate() > 30) {
brick.setStatusLight(StatusLight.RedFlash)
} else {

View File

@ -95,7 +95,7 @@ namespace sensors {
this.calibrating = true;
// may be triggered by a button click,
// give time for robot to settle
loops.pause(700);
pause(700);
// send a reset command
super.reset();
// switch back to the desired mode
@ -103,13 +103,13 @@ namespace sensors {
// wait till sensor is live
pauseUntil(() => this.isActive());
// give it a bit of time to init
loops.pause(1000)
pause(1000)
// compute drift
this._drift = 0;
if (this.mode == GyroSensorMode.Rate) {
for (let i = 0; i < 200; ++i) {
this._drift += this._query();
loops.pause(4);
pause(4);
}
this._drift /= 200;
}