O'Reilly logo

Raspberry Pi Cookbook for Python Programmers by Tim Cox

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Using Python to Drive Hardware

In this chapter, we will cover:

  • Controlling an LED
  • Responding to a button
  • A controlled shutdown button
  • The GPIO keypad input
  • Multiplexed color LEDs

Introduction

One of the key features of a Raspberry Pi computer that sets it apart from most other home/office computers is that it has the ability to directly interface with other hardware. The hardware General Purpose Input/Output (GPIO) pins on the Raspberry Pi can control a wide range of low-level electronics, from Light Emitting Diodes (LEDs) to switches, sensors, motors, servos, and even extra displays.

This chapter will focus on connecting the Raspberry Pi with some simple circuits and getting to grips with using Python to control and respond to the connected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required