Skip to main content

2018 | Buch

Learn Raspberry Pi Programming with Python

Learn to Program on the World's Most Popular Tiny Computer

insite
SUCHEN

Über dieses Buch

Learn how to program your nifty new $35 computer to make a web spider, a weather station, a media server, and more. This book explores 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.

Even if you're completely new to programming in general, you'll see how easy it is 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 use Pi with Arduino as well as Pi with Gertboard, an expansion board with an onboard ATmega microcontroller.

Learn Raspberry Pi Programming with Python has been fully updated in this new edition to cover the features of the new boards. You'll learn how to program in Python on your Raspberry Pi with hands-on examples and fun projects.

What You'll Learn

Set up your new Raspberry Pi

Build unique projects across a range of interests

Program basic functions and processes using PythonWho 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. Readers familiar with the 1st edition will enjoy the updated information in this new edition.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Introducing the Raspberry Pi
Abstract
So, you’ve got yourself a Raspberry Pi mini-computer and are thinking to yourself: “Now what?” Maybe it was a gift. Maybe you’d heard about this “Raspberry Pie thingamabob” and decided to find out what all of the ruckus was about. Perhaps you’re already experienced with computers, but not with Linux or Python. Maybe you’re a Linux geek who’s never made a servo move or lit up an LED with just a few lines of code and the correct hardware and software installed. Or maybe you’re familiar with computers only to the point of checking your email and surfing the web but are eager to learn more. Or perhaps (one of my favorite scenarios) you’re an educator who’s interested in teaching the next generation about computers and programming and technology in general.
Wolfram Donat
Chapter 2. Linux by the Seat of Your Pants
Abstract
The Raspberry Pi uses Linux as its standard operating system, which means if you don’t know anything about this awesome OS, you’re going to have to learn. Don’t worry—I’ll try to make this as painless as possible.
Wolfram Donat
Chapter 3. Introducing Python
Abstract
You may remember from the first chapter that the impetus behind the creation of the Raspberry Pi was to make programming more accessible for everyone, particularly kids. To that end, the creators wanted to release a relatively powerful computer that wouldn’t cost a lot of money and that anyone could simply connect to a keyboard, mouse, and monitor and start programming.
Wolfram Donat
Chapter 4. Electronics at 100 MPH
Abstract
You bought this book to learn to program using Python and to learn about the Raspberry Pi. You also want to build some cool projects, learn how the Pi runs Linux, and learn how you can use Python to interface with the Pi and various add-ons.
Wolfram Donat
Chapter 5. The Web Bot
Abstract
As anyone who has spent any time at all online can tell you, there is a lot of information available on the Internet. According to Google’s indexes, as of 2013 there were 4.04 billion web pages in existence. Sure, a lot of those pages are probably cat pictures and pornography, but there are also hundreds of millions of pages with information on them. Useful information. It has been said that every piece of information that has been digitized exists somewhere on the Internet. It just has to be found—not an easy task when the Internet looks something like Figure 5-1.
Wolfram Donat
Chapter 6. The Weather Station
Abstract
Since time immemorial, man has been fascinated by the weather, asking questions such as “Will it rain for our crops? Will it snow, so we can go skiing? Will a tornado carry our house to a fictitious country populated by supernatural women and flight-capable primates? We get some kind of weather every day—what’s it going to be today?”
Wolfram Donat
Chapter 7. The Media Server
Abstract
The concept behind a media server is to store all of your media files—music and movies—in one central location and then stream them from that location to whatever device in your house you choose. These days, almost every media device (and some non-media devices) can hook up to a network—if not the Internet, then at least your home network. This means that all of these machines, except for perhaps the refrigerator, can become clients, streaming media files from a central server. This is standard networking language; the computer that stores files—whether they be media files, spreadsheets, or web pages—is called a server, and computers that request those files are called clients.
Wolfram Donat
Chapter 8. The Home Security System
Abstract
Living in modern times can be . . . well, let’s face it: it can be a scary, stressful thing. Bad guys, and the crimes they commit, are everywhere. According to the FBI Crime Statistics website, there were approximately 7.9 million property crimes committed in the United States in 2016, the most recent year for which statistics are available. And although the property-crime rate has been steadily decreasing for the past fourteen years, the days of living on a peaceful street, where neighbors know each other and leave their doors unlocked while they go to work, are long gone.
Wolfram Donat
Chapter 9. The Cat Toy
Abstract
Most people are pretty familiar with the “cat chasing the little red dot” paradigm. It’s so popular it even had a short scene in one of the Shrek movies. Some cats will chase the laser spot until they drop. Some will only chase it for a little while. In any event, anyone who has a cat has probably used a laser pointer when playing with their feline friend at some point.
Wolfram Donat
Chapter 10. The Radio-Controlled Airplane
Abstract
Many of us have long dreamed of flight, of soaring through the air, free as a bird. Or, as the pilot John Magee Jr. put it, slipping the “surly bonds of Earth,” dancing through the skies “on laughter-silvered wings,” and topping “the wind-swept heights with easy grace.”
Wolfram Donat
Chapter 11. The Weather Balloon
Abstract
You may be familiar with weather balloons. Sometimes up to 20 feet in diameter, they can be filled with helium, given a small scientific payload, and made to ascend to the upper limits of the atmosphere, taking and recording various sensor readings as they go. Then, when the outside pressure becomes significantly less than the interior pressure of the balloon, they burst, and the payload falls back to Earth with the assistance of a small parachute. The group that launched the balloon tracks down the fallen package and retrieves the data. In this way, scientists and hobbyists can learn a great deal about the upper reaches of the atmosphere.
Wolfram Donat
Chapter 12. The Submersible
Abstract
Submersibles, both those remotely operated and autonomous ones, have been used for both scientific research purposes and private enterprise for several decades. They have studied life on the barren intercontinental plains, explored volcanic vents in the middle of the Atlantic Ocean, and gone places impossible for humans to go. In the commercial world, they were thrust into the spotlight during the Deepwater Horizon oil disaster in 2010. A fleet of submersibles was used to cap the oil well and stop the spill in 5,000-foot depths, far below what human divers could reach. They are routinely used to conduct maintenance on deep-sea oil rigs and offshore wave farms.
Wolfram Donat
Chapter 13. The Raspberry Pi and the Arduino
Abstract
Peanut butter and jelly. Batman and Robin. Dr. Jekyll and Mr. Hyde. Some things are just meant to go together, and we know it from the moment we first lay eyes on the combination. Such is the case with the Raspberry Pi and the Arduino. Many hobbyists and engineers (including me) had been using the Arduino for projects but were wishing there was a device similar in size with just a bit more power. Well, our wishes were granted with the introduction of the Pi. It has scads more processing power than the Arduino (the Arduino is only a microcontroller), and it has a full ARM processor—four cores’ worth in the new Pi 3. It was obviously a perfect match, and we’ve been using the two together since the Pi made its debut.
Wolfram Donat
Backmatter
Metadaten
Titel
Learn Raspberry Pi Programming with Python
verfasst von
Wolfram Donat
Copyright-Jahr
2018
Verlag
Apress
Electronic ISBN
978-1-4842-3769-4
Print ISBN
978-1-4842-3768-7
DOI
https://doi.org/10.1007/978-1-4842-3769-4