Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By : Dan Nixon
Book Image

Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

By: Dan Nixon

Overview of this book

Table of Contents (18 chapters)
Getting Started with Python and Raspberry Pi
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 6. Accessing the GPIO Pins

In this chapter, we will look at the simplest way of interfacing with digital electronics using the General Purpose Input and Output (GPIO) port on the Raspberry Pi. To do this, we will be using the RPi.GPIO module, which is installed as standard on the newer versions of Raspbian.

We will also take a quick look at some of the basics of digital electronics and the additional methods of communication offered by the Raspberry Pi, including UART.

Note that some of the examples later in the chapter will require some additional electronic components, all of which can be purchased from standard high street electronics retailers.

The components required are:

  • A small breadboard

  • Some 0.1" male to female jumper wires

  • A push to make a switch

  • Some LEDs

  • The appropriate resistor for the LEDs

The exact value of the resistor can be calculated using an online tool, such as the one found at ledcalc.com. Here, the supply voltage should be 3.3V, the LED current should be 20mA, and...