Skip to content

Commit 2b5e446

Browse files
committed
Add missing images
1 parent 0a4c229 commit 2b5e446

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

images/h-bridge.png

12.6 KB
Loading

images/mcb-wiring.png

48.1 KB
Loading

images/mcb.png

46.5 KB
Loading

motors.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ In this guide, you'll be controlling two motors from your Raspberry Pi using Pyt
1010

1111
A motor comprises two pins: positive and negative. If a 5V supply is provided to the positive pin, and 0V (ground) to the negative, it will drive forwards. If 0V is provided to the positive, and 5V to the negative, it will drive backwards. If no voltage is provided, the motor will stop.
1212

13+
![H-Bridge](images/h-bridge.png)
14+
15+
*Image credit: [Wikipedia](https://en.wikipedia.org/wiki/H_bridge), CC BY-SA*
16+
1317
## Wiring
1418

1519
You'll need to wire up two motors and your battery pack using the motor controller.
@@ -18,9 +22,9 @@ You'll need to wire up two motors and your battery pack using the motor controll
1822

1923
![Motor controller board](images/mcb.png)
2024

21-
1. Connect a battery pack to the power ports of the motor controller, connecting the positive (red) battery wire to the positive (+) power terminal on the motor controller, and the negative (black) battery wire to the negative (-) power terminal on the motor controller:
25+
1. Connect a battery pack to the power ports of the motor controller, connecting the positive (red) battery wire to the positive (+) power terminal on the motor controller, and the negative (black) battery wire to the negative (-) power terminal on the motor controller, and connect two motors:
2226

23-
![Connect battery pack](images/battery-pack.png)
27+
![Connect battery pack](images/mcb-wiring.png)
2428

2529
1. You'll need to know which GPIO pins your motor controller uses. Refer to the board's documentation. This will usually be described as Motor A and Motor B, or MA1, MA2, MB1, and MB2. Make a note of these pin numbers. If you're not sure which is which, you can investigate this next.
2630

@@ -53,8 +57,6 @@ First, you should learn to control motors by controlling the pins individually.
5357

5458
The motor should now be spinning! If not, check you are addressing the right pin numbers. The two pins should be connected to the same motor. Also, check your wiring and your batteries.
5559

56-
![Motor forward](images/motor-forward.png)
57-
5860
1. Now try turning that pin off, and turning the other pin on:
5961

6062
```python
@@ -64,8 +66,6 @@ First, you should learn to control motors by controlling the pins individually.
6466

6567
The motor should now be spinning in the opposite direction.
6668

67-
![Motor backward](images/motor-backward.png)
68-
6969
1. To stop the motor, just make sure both motors are off:
7070

7171
```python
@@ -179,8 +179,6 @@ So far, you have used simple on/off commands to control your motors. PWM (pulse-
179179

180180
Now you've learned how setting pins high and low can control a motor, you should proceed to using the built-in `Motor` class; this has all the functionality you just learned about, provided in a simple way, including PWM for speed.
181181

182-
![Motor](images/motor.png)
183-
184182
1. Restart the shell again (**Ctrl + F6**).
185183

186184
1. Import the `Motor` class:
@@ -241,8 +239,6 @@ Now you've learned how setting pins high and low can control a motor, you should
241239

242240
If you had a robot with two wheels you would want to control the two motors together, rather than separately, just like you did for the two pins of each motor. Luckily, there's also a `Robot` class in GPIO Zero.
243241

244-
![Robot](images/robot.png)
245-
246242
1. Restart the shell again (**Ctrl + F6**).
247243

248244
1. Import the `Motor` class:

0 commit comments

Comments
 (0)