Book Image

Getting Started with Raspberry Pi Zero

By : Richard Grimmett
Book Image

Getting Started with Raspberry Pi Zero

By: Richard Grimmett

Overview of this book

Raspberry Pi Zero is half the size of Raspberry Pi A, only with twice the utility. At just three centimeters wide, it packs in every utility required for full-fledged computing tasks. This practical tutorial will help you quickly get up and running with Raspberry Pi Zero to control hardware and software and write simple programs and games. You will learn to build creative programs and exciting games with little or no programming experience. We cover all the features of Raspberry Pi Zero as you discover how to configure software and hardware, and control external devices. You will find out how to navigate your way in Raspbian, write simple Python scripts, and create simple DIY programs.
Table of Contents (16 chapters)
Getting Started with Raspberry Pi Zero
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Controlling an H-bridge interface to the DC motors


The first step to make the platform mobile is to connect the Raspberry Pi Zero to your H-bridge. This allows you to control the speed of each wheel (or track) independently. Before you get started, let's spend some time learning the basics of motor control. Whether you choose the two-wheeled mobile platform or the tracked platform, the basic movement control is the same. The unit moves by engaging the motors. If the desired direction is straight ahead, the motors are run at the same speed. If you want to turn the unit, the motors are run at different speeds. The unit can turn in a circle if you run one motor forwards and the other one backwards.

The DC motors are fairly straightforward devices. The speed and direction of the motor is controlled by the magnitude and polarity of the voltage applied to its terminals. The higher the voltage, the faster the motor will turn. If you reverse the polarity of the voltage, you can reverse the direction...