You are previewing Learn Raspberry Pi Programming with Python.
O'Reilly logo
Learn Raspberry Pi Programming with Python

Book Description

Learn Raspberry Pi Programming with Python will show you how to program your nifty new $35 computer to make a web spider, a weather station, a media server, and more. You'll learn how to program in Python on your Raspberry Pi with hands-on examples and fun projects.

Even if you're completely new to programming in general, you'll figure out how to create a home security system, an underwater photography system, an RC plane with a camera, and even a near-space weather balloon with a camera.

You'll learn how to make a variety of fun and even useful projects, from a web bot to search and download files to a toy to drive your pets insane. You'll even learn how to use Pi with Arduino as well as Pi with Gertboard, an expansion board with an onboard ATmega microcontroller.

What you'll learn

  • Raspberry Pi and electronics basics

  • Quick intro to Linux

  • Python basics to get you started on a set of projects

  • How to make a variety of Pi and Python projects, including servers and gadgets with cameras

  • How to use Pi with Arduino and Gertboard

  • Who this book is for

    Readers who want to learn Python on a fun platform like the Pi and pick up some electronics skills along the way. No programming or Linux skill required, but a little experience with Linux will be helpful.

    Table of Contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Author
    6. About the Technical Reviewer
    7. Acknowledgments
    8. Introduction
    9. CHAPTER 1: Introducing the Raspberry Pi
      1. The History of Raspberry Pi
      2. Exploring the Pi Board
      3. Hardware Requirements of the Pi
      4. The Pi Operating System
      5. Connecting the Peripherals
      6. Configuring the Pi
      7. Shutting Down the Pi
      8. Summary
    10. CHAPTER 2: Linux by the Seat of Your Pants
      1. Getting Started with Linux on the Pi
      2. Commands
      3. Exercise: Navigating in the Linux File System
      4. Shells in Linux
      5. Package Managers
      6. Text Editors
      7. Summary
    11. CHAPTER 3: Introducing Python
      1. Scripting vs. a Programming Language
      2. The Python Philosophy
      3. Getting Started with Python
      4. Programming with Python
      5. Summary
    12. CHAPTER 4: Electronics at 100 MPH
      1. Basic Electricity Concepts
      2. Required Tools for Robotics
      3. General Safety Rules
      4. Organizing Your Workplace
      5. Bonus: Soldering Techniques
      6. Summary
    13. CHAPTER 5: The Web Bot
      1. Bot Etiquette
      2. The Connections of the Web
      3. Our Web Bot Concept
      4. Parsing Web Pages
      5. Coding with Python Modules
      6. Deciding What to Download
      7. Writing the Python Bot
      8. The Final Code
      9. Summary
    14. CHAPTER 6: The Weather Station
      1. A Shopping List of Parts
      2. Using the I2C Protocol
      3. Using an Anemometer
      4. Connecting the Digital Compass
      5. Connecting the Temperature/Humidity Sensor
      6. Connecting the Barometer
      7. Connecting the Bits
      8. The Final Code
      9. Summary
    15. CHAPTER 7: The Media Server
      1. A Shopping List of Parts
      2. Using an NTFS Drive
      3. Installing Samba
      4. Connecting with Linux/OS X
      5. Where’s Python?
      6. Summary
    16. CHAPTER 8: The Home Security System
      1. Dogs as Security
      2. Raspberry Pi as Security
      3. Using a Sensor Network
      4. Connecting All of the Bits
      5. The Final Code
      6. Summary
    17. CHAPTER 9: The Cat Toy
      1. A Shopping List of Parts
      2. The Concept Behind the Toy
      3. Creating and Using Random Numbers
      4. Using the GPIO Library
      5. Controlling the Servo
      6. Constructing the Servo Mechanism
      7. Constructing the Laser Mechanism
      8. Connecting the Laser to the Servo
      9. Connecting the Motion Sensor
      10. Connecting All the Bits
      11. The Final Code
      12. Summary
    18. CHAPTER 10: The Radio-Controlled Airplane
      1. A Shopping List of Parts
      2. Connecting the GPS Receiver to the Pi
      3. Setting Up a Log File
      4. Formatting a KML File
      5. Using Threading and Objects
      6. Setting Up Automatic Startup
      7. Connecting the Bits
      8. The Final Code
      9. Summary
    19. CHAPTER 11: The Weather Balloon
      1. A Shopping List of Parts
      2. Setting Up the GPS Receiver
      3. Storing the GPS Data
      4. Installing PiFM
      5. Installing festival
      6. Installing FFMPEG
      7. Preparing the Pi
      8. Using Threading and Objects
      9. Connecting the Bits
      10. Reviewing the Photo Results
      11. The Final Code
      12. Summary
    20. CHAPTER 12: The Submersible
      1. A Shopping List of Parts
      2. Accessing the Raspberry Pi’s GPIO pins
      3. Installing the Raspberry Pi Camera Board
      4. Controlling the Sub
      5. Starting the Program Remotely
      6. The Final Control Program
      7. The Final Code
      8. Constructing the Sub
      9. Summary
    21. CHAPTER 13: The Gertboard
      1. Examining the Board
      2. Some Example Projects
      3. Summary
    22. CHAPTER 14: The Raspberry Pi and the Arduino
      1. Exploring the Arduino
      2. Installing the Arduino IDE on the Pi
      3. Running a Servo
      4. The Arduino and the Gertboard
      5. Summary
    23. Index