More samples (#896)

* coast or brake

* fix title

* added lesson
This commit is contained in:
Peli de Halleux
2019-08-31 06:05:36 -07:00
committed by GitHub
parent 12b1eb349b
commit d5194b8d28
6 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,14 @@
# Coast Or Brake
```blocks
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
// tell motor to brake once the run command is done
motors.largeB.setBrake(true)
motors.largeB.run(100, 1, MoveUnit.Rotations)
})
brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
// tell motor to coast once the run command is done
motors.largeB.setBrake(false)
motors.largeB.run(100, 1, MoveUnit.Rotations)
})
```