pxt-ev3/docs/tutorials/city-shaper/mission-2.md
Peli de Halleux 5314515619
Crane mission (#907)
* dummy page

* robot 1 lesson

* added lesson 2

* added mission 2

* added link
2019-09-06 16:10:33 -07:00

20 lines
694 B
Markdown

# Mission 2 Lesson
Use the program below to tell your robot how to solve the Crane Mission (Mission 2).
```blocks
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
motors.largeBC.steer(0, 25, 2.25, MoveUnit.Rotations)
control.timer1.reset()
while (control.timer1.seconds() < 1.5) {
motors.largeBC.steer(sensors.color1.light(LightIntensityMode.Reflected) - 40, 50)
}
motors.largeBC.stop()
motors.largeBC.steer(0, 15, 0.25, MoveUnit.Rotations)
motors.mediumA.run(25, 60, MoveUnit.Degrees)
pause(2000)
motors.mediumA.run(-25, 1, MoveUnit.Seconds)
motors.largeBC.steer(0, -100, 4, MoveUnit.Rotations)
})
motors.largeBC.setBrake(true)
```