Book 8
Working with Raspberry Pi
Contents at a Glance
Chapter 1: Introducing Raspberry Pi
Introducing the Raspberry Pi
Considering Raspberry Pi Versions
Setting Up a Raspberry Pi
Installing the Raspbian Operating System
Logging In to Raspberry Pi
Understanding the File System
Fixing the Keyboard
Writing Your First Raspberry Pi Program
Examining GPIO Ports
Connecting an LED to a GPIO Port
Flashing an LED in Python
Configuring IDLE for Root Privileges
Building a Raspberry Pi LED Flasher
Project 55: Blinking an LED with a Raspberry Pi
Chapter 2: Programming in Python
Looking Closer at Python
Building a Test Circuit
Project 56: A Raspberry Pi LED Test Board
Flashing the LEDs
Using Comments
Creating Identifiers
Using Constants
Using Variables
Creating Your Own Functions
Using If Statements
Using While Loops
Using For Loops
Looking at Python Lists
Chapter 3: Reading Digital and Analog Input
Using a GPIO Port for Digital Input
Checking the Status of a Switch in Python
Project 57: A Push-Button-Controlled Raspberry Pi LED Flasher
Reading Analog Input
Enabling SPI on Your Raspberry Pi
Using the MCP3008 in Python
Using the mcp3008 Package
Project 58: A Variable-Rate LED Flasher