replacing loops.pause -> pause, loops.forever -> forever
This commit is contained in:
@ -20,7 +20,7 @@ Reset the motor connected to port **A** and run it for for 2 seconds at a speed
|
||||
let motorAngle = 0;
|
||||
motors.largeA.reset()
|
||||
motors.largeA.setSpeed(45)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
motorAngle = motors.largeA.angle()
|
||||
```
|
||||
|
@ -16,11 +16,11 @@ See if the motor turns the same number of times for each of two count periods. R
|
||||
let tachoCount = 0;
|
||||
motors.largeA.reset()
|
||||
motors.largeA.setSpeed(50)
|
||||
loops.pause(10000)
|
||||
pause(10000)
|
||||
tachoCount = motors.largeA.tacho()
|
||||
motors.largeA.clearCounts()
|
||||
motors.largeA.setSpeed(50)
|
||||
loops.pause(10000)
|
||||
pause(10000)
|
||||
if (tachoCount == motors.largeA.tacho()) {
|
||||
brick.showString("Motor turns equal.", 1)
|
||||
} else {
|
||||
|
@ -14,12 +14,12 @@ See what the angle count is when a motor is stopped. Then, try it again after a
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
brick.showString("Angle count:", 1)
|
||||
brick.showNumber(motors.largeA.angle(), 2)
|
||||
motors.largeA.setSpeed(30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.reset()
|
||||
brick.showString("Angle count:", 4)
|
||||
brick.showNumber(motors.largeA.angle(), 5)
|
||||
|
@ -20,7 +20,7 @@ Run the motor connected to port **A** for 2 seconds at a speed of `30`. Stop and
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
motors.largeA.setBrake(true)
|
||||
```
|
||||
|
@ -18,12 +18,12 @@ Run the motor connected to port **A** for 2 seconds at a speed of `30`. Stop and
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.setInverted(true)
|
||||
motors.largeA.setSpeed(-30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
```
|
||||
|
||||
|
@ -23,7 +23,7 @@ Turn off the speed regulation for the motor connected to port **A**.
|
||||
```blocks
|
||||
motors.largeA.setRegulated(false)
|
||||
motors.largeA.setSpeed(75)
|
||||
loops.pause(20000)
|
||||
pause(20000)
|
||||
motors.largeA.stop()
|
||||
```
|
||||
|
||||
|
@ -69,7 +69,7 @@ Run the motor connected to port **A** continuously. Pause 20 seconds and then st
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(75)
|
||||
loops.pause(20000)
|
||||
pause(20000)
|
||||
motors.largeA.stop()
|
||||
```
|
||||
|
||||
@ -79,7 +79,7 @@ Run the motor connected to port **A** in reverse. Pause 5 seconds and then stop
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(-60)
|
||||
loops.pause(5000)
|
||||
pause(5000)
|
||||
motors.largeA.stop()
|
||||
```
|
||||
|
||||
|
@ -21,7 +21,7 @@ motors.largeA.setRegulated(false)
|
||||
motors.largeA.setSpeed(55)
|
||||
brick.showString("Actual speed:", 1)
|
||||
for (let i = 0; i < 30; i++) {
|
||||
loops.pause(500)
|
||||
pause(500)
|
||||
brick.showNumber(motors.largeA.speed(), 3)
|
||||
}
|
||||
motors.largeA.stop()
|
||||
|
@ -14,9 +14,9 @@ Run the motor connected to port **A** for 2 seconds at a speed of `30`. Stop and
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(30)
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.stop()
|
||||
loops.pause(2000)
|
||||
pause(2000)
|
||||
motors.largeA.setSpeed(50)
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@ Run the motor connected to port **A** at half speed for 5 seconds. Display the n
|
||||
|
||||
```blocks
|
||||
motors.largeA.setSpeed(50)
|
||||
loops.pause(5000)
|
||||
pause(5000)
|
||||
motors.largeA.stop()
|
||||
brick.showString("Motor rotations:", 1)
|
||||
brick.showNumber(motors.largeA.tacho() / 360, 3)
|
||||
|
Reference in New Issue
Block a user