Chapter 4

Making Things Move with Python

IN THIS CHAPTER

Bullet How to make things move with Python

Bullet Understanding DC motors and software

Bullet Using a servo motor

Bullet Making a stepper motor step

Making things move around with Python is undeniably cool. With motors, physical computing goes to a whole new level.

Robots, microwaves, refrigerators, and electric cars all use electric motors to move around, blow air, pump coolant, and take you 60mph wherever you want to go. Electric motors are everywhere!

At its simplest, an electric motor is a machine that converts electrical energy into mechanical energy. In this chapter, we talk about DC (direct current) motors. Direct current is a single fixed voltage, like 9V or 5V or 3.3V. Alternating current (AC), on the other hand, is what you get out of your house outlets.

Interestingly, electric motors consume more than half of the electric energy produced in the United States.

Exploring Electric Motors

An electric motor is all about magnetism. All motors use magnets to create motion. All magnets have a north and a south pole. North to north and south to south ...

Get Python All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.