Edits for 'citys shaper' robot tutorials (#911)
This commit is contained in:
parent
186c86d2b1
commit
6b78e08053
@ -1,41 +1,40 @@
|
|||||||
# Robot 1 Lesson
|
# Robot 1 Lesson
|
||||||
|
|
||||||
## Step 1 Build Your Driving Base Robot @unplugged
|
## Step 1 - Build Your Driving Base Robot @unplugged
|
||||||
|
|
||||||
Build the robot driving base:
|
Build the robot driving base:
|
||||||
|
|
||||||
[![EV3 Driving Base](/static/lessons/common/ev3-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf)
|
[![EV3 Driving Base](/static/lessons/common/ev3-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf)
|
||||||
|
|
||||||
If clicking the above image doesn't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
If clicking on the image above doesn't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
||||||
|
|
||||||
|
## Step 2 - Show an image @fullscreen
|
||||||
|
|
||||||
## Step 2 Show an image @fullscreen
|
At first, it's nice to know that your program is running. Plug in a ``||brick:show mood||`` from the **BRICK** toolbox drawer
|
||||||
|
into the ``||loops:on start||`` block. Change the image to something else if you want!
|
||||||
It's useful to know that your program is running. Plug a ``||brick:show mood||`` from the **BRICK** toolbox
|
|
||||||
inside the ``||loops:on start||`` block. Change the image if you want!
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.showMood(moods.neutral)
|
brick.showMood(moods.neutral)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3 Try your code @fullscreen
|
## Step 3 - Try your code @fullscreen
|
||||||
|
|
||||||
Look at the simulator and check that your image is showing up. When you are ready, press the **DOWNLOAD** button
|
Look at the simulator and check that your image is showing on the screen. When you are ready, press the **DOWNLOAD** button
|
||||||
and follow the instructions to transfer your code on the brick.
|
and follow the instructions to transfer your code on the brick.
|
||||||
|
|
||||||
## Step 4 Steer motors @fullscreen
|
## Step 4 - Steer motors @fullscreen
|
||||||
|
|
||||||
Drag a ``||motors:steer motors||`` block from the **MOTORS** toolbox and snap it under ``||brick:show mood||``.
|
Drag a ``||motors:steer motors||`` block from the **MOTORS** toolbox drawer and snap it in under ``||brick:show mood||``.
|
||||||
Click on the plus and make sure to tell your motors to turn **1** rotation.
|
Click on the **(+)** symbol and make sure to tell your motors to turn **1** rotation.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.showMood(moods.neutral)
|
brick.showMood(moods.neutral)
|
||||||
motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations)
|
motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 5 Try your code @fullscreen
|
## Step 5 - Try your code @fullscreen
|
||||||
|
|
||||||
Whenever you make a code change, the simulator will restart and you can preview what your code will do there.
|
Whenever you make a code change, the simulator will restart so you can see what your latest change will do.
|
||||||
When you are ready, click **DOWNLOAD** and follow the instructions to transfer the code into your brick.
|
When you are ready, click **DOWNLOAD** and follow the instructions to transfer the code into your brick.
|
||||||
|
|
||||||
**Remember** Take the driving base apart at the end of the session, so the other group can build it next time
|
**Remember**: Take the driving base apart at the end of the session so that another group can build their robot too.
|
@ -1,27 +1,26 @@
|
|||||||
# Robot 2 Lesson
|
# Robot 2 Lesson
|
||||||
|
|
||||||
## Step 1 Build Your Driving Base Robot @unplugged
|
## Step 1 - Build Your Driving Base Robot @unplugged
|
||||||
|
|
||||||
Build the robot driving base:
|
Build the robot driving base:
|
||||||
|
|
||||||
[![EV3 Driving Base](/static/lessons/common/ev3-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf)
|
[![EV3 Driving Base](/static/lessons/common/ev3-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-rem-driving-base-79bebfc16bd491186ea9c9069842155e.pdf)
|
||||||
|
|
||||||
If clicking the above image doesn't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
If clicking on the image above doesn't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
||||||
|
|
||||||
|
## Step 2 - Show an image and move @fullscreen
|
||||||
|
|
||||||
## Step 2 Show an image and move @fullscreen
|
Add blocks to the ``||loops:on start||`` block to show an image and move the motors **B+C** for ``1`` rotation.
|
||||||
|
|
||||||
Add the blocks to show an image and move the motors **B+C** for ``1`` rotation.
|
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.showMood(moods.neutral)
|
brick.showMood(moods.neutral)
|
||||||
motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations)
|
motors.largeBC.steer(0, 50, 1, MoveUnit.Rotations)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 6 Brick button @fullscreen
|
## Step 3 - Brick button @fullscreen
|
||||||
|
|
||||||
Let's change the code so that your robot moves when the **UP** button is pressed.
|
Let's change the code so that your robot moves when the **UP** button is pressed.
|
||||||
Add a ``||brick:on button enter||`` block and move the ``||motors:steer motors||`` under it.
|
Add an ``||brick:on button up||`` block and move ``||motors:steer motors||`` inside of it.
|
||||||
After downloading your code, press **UP** to move the robot.
|
After downloading your code, press **UP** to move the robot.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
@ -31,11 +30,11 @@ brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
brick.showMood(moods.neutral)
|
brick.showMood(moods.neutral)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 6 Braking @fullscreen
|
## Step 4 - Braking @fullscreen
|
||||||
|
|
||||||
When the motors are done turning, the robot keeps on moving for a short distance.
|
When the motors are done turning, the robot keeps on moving for a short distance.
|
||||||
Turn on the **brakes**, so that your robot stops immediately.
|
Turn on the **brakes** so that your robot stops immediately.
|
||||||
Drag a ``||motors:set brake||`` block into the ``||loops:on start||`` and set it **ON** to the BC motors.
|
Drag a ``||motors:set brake||`` block into the ``||loops:on start||`` and set it to **ON** for the the **BC** motors.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonUp.onEvent(ButtonEvent.Pressed, function () {
|
||||||
@ -45,11 +44,12 @@ brick.showMood(moods.neutral)
|
|||||||
motors.largeBC.setBrake(true)
|
motors.largeBC.setBrake(true)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Step 5 - Left and Right turn @fullscreen
|
||||||
|
|
||||||
## Step 8 Left and Right turn @fullscreen
|
Let's make the robot turn to the left when the **LEFT** button is pressed on the brick.
|
||||||
|
Find an ``||brick:on button||`` block and put a ``||motors:steer motors||`` in it. Make the turn ratio drive the motor to left.
|
||||||
Let's make the robot turn to the left when the **LEFT** button is pressed on the brick (and same for the right button).
|
Get another ``||brick:on button||`` and set it to run when the **RIGHT** is pressed.
|
||||||
Add a ``||steer motors||`` and change the turn ratio to go left.
|
Put a ``||motors:steer motors||`` in for that button and set the turn ratio to drive to the right.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {
|
||||||
@ -60,10 +60,10 @@ brick.buttonRight.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 9 Backwards @fullscreen
|
## Step 6 - Backwards @fullscreen
|
||||||
|
|
||||||
Let's make the robot turn to the right when the **RIGHT** button is pressed on the brick.
|
Let's make the robot go backwards when the **DOWN** button is pressed on the brick.
|
||||||
Add a ``||steer motors||`` and change the speed to be negative. This will make the motor go backwards.
|
Add a ``||motors:steer motors||`` to an ``||brick:on button||`` block and change the speed to be negative. This will make the motor go backwards.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
||||||
@ -71,15 +71,15 @@ brick.buttonDown.onEvent(ButtonEvent.Pressed, function () {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 10 Add a Ultrasonic sensor @fullscreen
|
## Step 7 - Add an Ultrasonic sensor @fullscreen
|
||||||
|
|
||||||
Add a Ultrasonic sensor to your driving base.
|
Add an Ultrasonic sensor to your driving base.
|
||||||
|
|
||||||
[![EV3 Driving Base with Ultrasonic Sensor](/static/lessons/common/ev3-ultrasonic-sensor-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-ultrasonic-sensor-driving-base-61ffdfa461aee2470b8ddbeab16e2070.pdf)
|
[![EV3 Driving Base with Ultrasonic Sensor](/static/lessons/common/ev3-ultrasonic-sensor-driving-base.jpg)](https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-ultrasonic-sensor-driving-base-61ffdfa461aee2470b8ddbeab16e2070.pdf)
|
||||||
|
|
||||||
If clicking the above images don't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
If clicking on the image above doesn't open the instructions, right-click on the image and choose "Save link as..." to download the PDF.
|
||||||
|
|
||||||
## Step 11 @fullscreen
|
## Step 8 - Stopping distance @fullscreen
|
||||||
|
|
||||||
Create a program that moves the Driving Base and makes it stop 6 cm from the Cuboid.
|
Create a program that moves the Driving Base and makes it stop 6 cm from the Cuboid.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user