Skip to content

Commit d4a22e0

Browse files
committed
Clean up tutorial content formatting
1 parent b65e5be commit d4a22e0

File tree

3 files changed

+13
-22
lines changed

3 files changed

+13
-22
lines changed

docs/tutorials/basic-movement.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
---
2-
title: Basic Movement
3-
---
1+
# Basic movement
42

53
The example program we'll write will do a number of things with the motor: forwards and backwards, and different power settings, for example. Let's begin. To start off, we'll just make a motor move forwards, then backwards, and then repeat.
64

7-
### Forwards & backwards
5+
## Forwards & backwards
86

97
Doing this is actually very easy; the only thing you need to realise is that a positive number is forwards and a negative number is backwards.
108

11-
{{% notice warning %}}
12-
The actual direction of travel of a motor, when mounted on a robot, will depend on its orientation and the way in which the wires are connected to the motor board. If the motor appears to be going in the wrong direction, just swap the motor's positive and negative wires over.
13-
{{% /notice %}}
9+
!!! tip
10+
The actual direction of travel of a motor, when mounted on a robot, will depend on its orientation and the way in which the wires are connected to the motor board. If the motor appears to be going in the wrong direction, just swap the motor's positive and negative wires over.
1411

1512
Here's the code:
1613

@@ -37,19 +34,18 @@ while True:
3734
r.sleep(4)
3835
```
3936

40-
You're familiar with the first few lines; in fact, the only lines you may not be familiar with are the `r.motor_boards...` lines. For a comprehensive reference to the `motor` object, see [`motor` API](/api/motor-board) page.
37+
You're familiar with the first few lines; in fact, the only lines you may not be familiar with are the `r.motor_boards...` lines. For a comprehensive reference to the `motor` object, see [`motor` API](../api/motor-board.md) page.
4138
But, to summarise:
4239

43-
`r.motor_boards.m0.power = 0.5` sets the target power of the motor connected to output 0 on the first [motor board](/kit/motor-board) to half speed forwards (i.e. a duty-cycle of 0.5 forwards). As you would expect, then, `-0.5` will put the this motor into reverse at half power.
40+
`r.motor_boards.m0.power = 0.5` sets the target power of the motor connected to output 0 on the first [motor board](../kit/motor-board.md) to half speed forwards (i.e. a duty-cycle of 0.5 forwards). As you would expect, then, `-0.5` will put the this motor into reverse at half power.
4441
`r.motor_boards.m0.power = 0` will brake the motor and stop it.
4542

4643
So, if you put the above code on your robot, you should be able to see a motor spin forwards, stop, spin backwards, stop, and then repeat...
4744

48-
{{% notice note %}}
49-
If you find that the motor doesn't turn when you run the above code, check that you've got all the cables connected to the right places, in particular note that the motor board has _two_ outputs.
50-
{{% /notice %}}
45+
!!! info
46+
If you find that the motor doesn't turn when you run the above code, check that you've got all the cables connected to the right places, in particular note that the motor board has _two_ outputs.
5147

52-
### Changing the speed
48+
## Changing the speed
5349

5450
Now we're going to modify the program to vary the speed of the motor. Our aim is to do the forwards and backwards bit (as above), but, before we loop round again, ramp the power up to 70%, then down to -70%, and then back to 0 (all in steps of 10%). Here's the code:
5551

docs/tutorials/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ title: Tutorials
33
---
44

55
This part of the docs contains some practical guides for getting starting with both Python and the simulator.
6-
7-
* [Basic Movement](basic-movement) - explains how to use the kit to operate a motor
8-
* [Python: A Whirlwind Tour](python-whirlwind-tour) - a guide to using Python, aimed towards those who haven't used it before

docs/tutorials/python-whirlwind-tour.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
---
2-
title: "Python: A Whirlwind Tour"
3-
---
1+
# Python: A Whirlwind Tour
42

5-
# The Basics
3+
## Installation
64

7-
## Installing Python on Windows
5+
### Installing Python on Windows
86

97
Below are step-by-step instructions for installing Python 3.9.6 (which is required for the competition):
108

@@ -22,7 +20,7 @@ Below are step-by-step instructions for installing Python 3.9.6 (which is requir
2220

2321
![A window with the heading "Setup was successful" and a 'close' button in the bottom right.](/img/tutorials/whrl-win-2.png)
2422

25-
## Installing Python on Mac
23+
### Installing Python on Mac
2624

2725
Below are step-by-step instruction for installing Python 3.9.6 (which is required for the competition):
2826

0 commit comments

Comments
 (0)