More gyro lessons (#933)
* updated pauseuntil * updated youtube link * updated docs
This commit is contained in:
@ -27,7 +27,7 @@
|
||||
}, {
|
||||
"name": "Turn with Gyro",
|
||||
"description": "Use the gyro for precise turns.",
|
||||
"youTubeId": "pTRAs1we51Y"
|
||||
"youTubeId": "I7ncuXAfBwk"
|
||||
}, {
|
||||
"name": "Moving with Gyro",
|
||||
"description": "Use the gyro for correct the robot trajectory.",
|
||||
|
@ -9,6 +9,12 @@
|
||||
"cardType": "tutorial",
|
||||
"url":"/tutorials/calibrate-gyro",
|
||||
"imageUrl":"/static/tutorials/calibrate-gyro.png"
|
||||
}, {
|
||||
"name": "Turn",
|
||||
"description": "Use the gyro to turn precisely",
|
||||
"cardType": "tutorial",
|
||||
"url":"/tutorials/turn-with-gyro",
|
||||
"imageUrl":"/static/tutorials/turn-with-gyro.png"
|
||||
}, {
|
||||
"name": "Move Straight",
|
||||
"description": "Use the gyro to correct the trajectory of the robot",
|
||||
|
43
docs/tutorials/turn-with-gyro.md
Normal file
43
docs/tutorials/turn-with-gyro.md
Normal file
@ -0,0 +1,43 @@
|
||||
# Turn With Gyro
|
||||
|
||||
## Introduction @fullscreen
|
||||
|
||||
Use the gyro to measure how much the robot is turning, regardless if your wheels are slipping.
|
||||
|
||||
## Step 1 Calibrate
|
||||
|
||||
Add the ``||sensors:calibrate gyro||`` block to make sure your gyro is ready to use.
|
||||
|
||||
```blocks
|
||||
sensors.gyro2.calibrate()
|
||||
```
|
||||
|
||||
## Step 2 Turn
|
||||
|
||||
Use motor blocks to make the robot turn. Don't go too fast!
|
||||
|
||||
```blocks
|
||||
sensors.gyro2.calibrate()
|
||||
motors.largeBC.steer(200, 20)
|
||||
```
|
||||
|
||||
## Step 3 Pause for turn
|
||||
|
||||
Use the ``||sensors:pause until rotated||`` block to wait until the desired amount of rotation has occured.
|
||||
|
||||
```blocks
|
||||
sensors.gyro2.calibrate()
|
||||
motors.largeBC.steer(200, 20)
|
||||
sensors.gyro2.pauseUntilRotated(90)
|
||||
```
|
||||
|
||||
## Step 4 Stop
|
||||
|
||||
Stop the motors!
|
||||
|
||||
```blocks
|
||||
sensors.gyro2.calibrate()
|
||||
motors.largeBC.steer(200, 20)
|
||||
sensors.gyro2.pauseUntilRotated(90)
|
||||
motors.stopAll()
|
||||
```
|
Reference in New Issue
Block a user