Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications)

You're reading from   Getting Started with Python and Raspberry Pi (Redirected from Learning Python By Developing Raspberry Pi Applications) Learn to design and implement reliable Python applications on the Raspberry Pi using a range of external libraries, the Raspberry Pis GPIO port, and the camera module

Arrow left icon
Product type Paperback
Published in Sep 2015
Publisher
ISBN-13 9781783551590
Length 200 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dan Nixon Dan Nixon
Author Profile Icon Dan Nixon
Dan Nixon
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Your First Steps with Python on the Pi FREE CHAPTER 2. Understanding Control Flow and Data Types 3. Working with Data Structures and I/O 4. Understanding Object-oriented Programming and Threading 5. Packaging Code with setuptools 6. Accessing the GPIO Pins 7. Using the Camera Module 8. Extracting Data from the Internet 9. Creating Command-line Interfaces 10. Debugging Applications with PDB and Log Files 11. Designing Your GUI with Qt Index

The GPIO library


The RPi.GPIO module provides a simple interface to the basic digital logic functionality of the GPIO header as well as software synthesized PWM, which allows the Pi to output an analog like signal.

Before starting to use the GPIO pins, it is important to know what each pin can do and what it is connected to. The following diagram shows the pinouts for each version and revision of the Raspberry Pi:

Note

Note that the Raspberry Pi 2 has the same pinout as the Raspberry Pi B+.

Typically, when using the GPIO pins, you should avoid using the GPIOs 14 and 15 as they are by default used for a serial terminal which provides access to the shell running on the Pi. GPIOs 0, 1, 2, and 3 should also be avoided as they are used for the I2C interface, which requires a pull-up resistor to be used on the pins that is fitted by default and can cause issues with some devices.

Single LED output

To demonstrate the basic use of the GPIO library, we will create a simple script that will flash an LED...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image