Preface

It’s easy to understand why people were skeptical of the Raspberry Pi when it was first announced in 2011. A credit-card–sized computer for $35 seemed like a pipe dream. Which is why, when it started shipping, the Raspberry Pi created a frenzy of excitement.

Demand outstripped supply for months, and the waitlists for these minicomputers were very long. Besides the price, what is it about the Raspberry Pi that tests the patience of this hardware-hungry mass of people? Before we get into everything that makes the Raspberry Pi so great, let’s talk about its intended audience.

Eben Upton and his colleagues at the University of Cambridge noticed that students applying to study computer science didn’t have the skills that they did in the 1990s.

They attributed this to—among other factors—the “rise of the home PC and games console to replace the Amigas, BBC Micros, Spectrum ZX and Commodore 64 machines that people of an earlier generation learned to program on.”1

Because the computer has become important for every member of the household, it may also discourage younger members from tinkering around and possibly putting such a critical tool out of commission for the family.

Meanwhile, mobile phone and tablet processors had become less expensive while getting more powerful, clearing the path for the Raspberry Pi’s leap into the world of ultra-cheap-yet-serviceable computer boards.

As Linus Torvalds, the founder of Linux, said in an interview with BBC News, Raspberry Pi makes it possible to “afford failure.”2

Raspberry Pi Foundation

It’s important to note that Raspberry Pi primarily exists to advance the charitable mission of the Raspberry Pi Foundation. That mission is to “put the power of digital making into the hands of people all over the world.” The Raspberry Pi Foundation hopes that people—kids especially—will learn to code, learn how computers work, and learn how to make things with computers.

With every Raspberry Pi purchase, you’re not only paying for the cost of the hardware, fulfillment, and the engineering behind it, you’re also making a contribution to the free online resources, free teacher training, and special programs that the Raspberry Pi Foundation offers to further its charitable mission.

As you’ll learn in this book, the Raspberry Pi is great for learning, but it also makes a powerful tool. Even if the primary purpose of the board is for education, we find that its utilization stretches into commercial and industrial applications. Companies use it for things such as sensor networks, remote monitoring, and product prototyping. Even though the Raspberry Pi is great for kids, it’s important to remember that it’s a real computer. It’s not a toy or some kind of watered-down device.

What Can You Do with It?

One of the great things about the Raspberry Pi is that there’s no single way to use it. Whether you just want to watch videos and browse the Web, or you want to hack, learn, and make with the board, the Raspberry Pi is a flexible platform for fun, utility, and experimentation. Here are just a few of the different ways you can use a Raspberry Pi:

General-purpose computing

It’s important to remember that the Raspberry Pi is a computer and you can, in fact, use it as one. After you get it up and running in Chapter 1, you can launch a web browser to access email, news sites, and social networks, which is a lot of what we use computers for these days. Going beyond the Web, you can launch the free and open source LibreOffice productivity suite, which allows you to work with documents and spreadsheets when you don’t have an Internet connection.

Learning to program

Because the Raspberry Pi is meant as an educational tool to encourage kids to experiment with computers, it comes preloaded with interpreters and compilers for many different programming languages. If you’re eager to jump into writing code, the Python programming language is a great way to get started, and we cover the basics of it in Chapter 4. But with Raspberry Pi, you’re not limited to only Python. You can write programs for your Raspberry Pi in many different programming languages, including C, Ruby, Java, and Perl. There’s even a programming language and development environment for creating music called Sonic Pi.

Project platform

The Raspberry Pi differentiates itself from a regular computer not only because of its price and size, but also because of its ability to integrate with electronics projects. Starting in Chapter 6, we’ll show you how to use the Raspberry Pi to control components from LEDs to AC devices, and you’ll learn how to read the state of buttons and switches.

Product prototyping

More and more electronics products use Linux computers inside, and now this world of embedded Linux is more accessible than ever. Let’s say you create something with your Raspberry Pi that would make a great product for the everyday consumer. With the Raspberry Pi Compute Module (a smaller version of the board that we’ll discuss later), it becomes possible to create a product that’s powered by Raspberry Pi.

Raspberry Pi for Makers

As makers, we have a lot of choices when it comes to platforms on which to build technology-based projects. Lately, microcontroller development boards like the Arduino have been a popular choice because they’ve become very easy to work with. But system on a chip platforms like the Raspberry Pi are a lot different than traditional microcontrollers in many ways. In fact, the Raspberry Pi has more in common with your computer than it does with an Arduino.

This is not to say that a Raspberry Pi is better than a traditional microcontroller; it’s just different. For instance, if you want to make a basic thermostat, you’re probably better off using an Arduino Uno or similar microcontroller for purposes of simplicity. But if you want to be able to remotely access the thermostat via the Web to change its settings and download temperature log files, you should consider using the Raspberry Pi.

Choosing between one or the other will depend on your project’s requirements, and in fact, you don’t necessarily have to choose between the two. In Chapter 5, we’ll show you how to use the Raspberry Pi to program the Arduino and get them communicating with each other.

As you read this book, you’ll gain a better understanding of the strengths of the Raspberry Pi and how it can become another useful tool in the maker’s toolbox.

Linux and Raspberry Pi

Your typical computer is running an operating system, such as Windows, OS X, or Linux. It’s what starts up when you turn your computer on, and it provides your applications access to hardware functions of your computer. For instance, if you’re writing an application that accesses the Internet, you can use the operating system’s functions to do so. You don’t need to understand and write code for every single type of Ethernet or WiFi hardware out there.

Like any other computer, the Raspberry Pi also uses an operating system, and the “stock” OS is a flavor of Linux called Raspbian. Linux is a great match for Raspberry Pi because it’s free and open source. On one hand, Linux keeps the price of the platform low, and on the other, it makes the Raspberry Pi more hackable.

And you’re not limited to just Raspbian, as there are many different flavors, or distributions, of Linux that you can load onto the Raspberry Pi. There are even several non-Linux OS options available out there. Take a look at Chapter 3 for a rundown of different Linux and non-Linux operating systems. While creating this book, we used the standard Raspbian distribution that’s available from Raspberry Pi’s download page. It’s a good place to start.

If you’re not familiar with Linux, don’t worry, Chapter 2 will equip you with the fundamentals you’ll need to know to get around.

What Others Have Done with Raspberry Pi

When you have access to an exciting new technology, it can be tough deciding what to do with it. Fortunately, there’s no shortage of interesting and creative Raspberry Pi projects out there to get inspiration from. At Make:, we’ve seen a lot of fantastic uses of the Raspberry Pi come our way, and we want to share some of our favorites:

Arcade Game Coffee Table

Instructables user grahamgelding uploaded a step-by-step tutorial on how to make a coffee table that doubles as a classic arcade game emulator using the Raspberry Pi. To get the games running on the Pi, he used MAME (Multiple Arcade Machine Emulator), a free, open source software project that lets you run classic arcade games on modern computers. MAME is included with RetroPie, mentioned in “But Wait…There’s More!”. Within the table itself, he mounted a 24-inch LCD screen connected to the Raspberry Pi via HDMI, classic arcade buttons, and a joystick connected to the Pi’s general-purpose input/output (GPIO) pins to be used as inputs.

RasPod

Aneesh Dogra, a teenager in India, was one of the runners-up in Raspberry Pi Foundation’s 2012 Summer Coding Contest. He created Raspod, a Raspberry Pi–based, web-controlled MP3 audio player. Built with Python and a web framework called Tornado, Raspod lets you remotely log in to your Raspberry Pi to start and stop the music, change the volume, select songs, and make playlists. The music comes out of the Raspberry Pi’s audio jack, so you can use it with a pair of computer speakers, or you can connect it to a stereo system to enjoy the tunes.

Raspberry Pi Supercomputer

Many supercomputers are made of clusters of standard computers linked together, and computational jobs are divided among all the different processors. A group of computational engineers at the University of Southampton in the United Kingdom linked 64 Raspberry Pis to create an inexpensive supercomputer. While it’s nowhere near the computational power of the top-performing supercomputers of today, it demonstrates the principles behind engineering such systems. Best of all, the rack system used to hold all these Raspberry Pis was built with Lego bricks by the team leader’s six-year-old son.

If you do something interesting with your Raspberry Pi, we’d love to hear about it. You can submit your projects to the Make: editorial team through the contribute form on Makezine.com. You can also send us a tweet at @MattRichardson and @fluxly.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This element signifies a tip or suggestion.

Note

This element signifies a general note.

Warning

This element indicates a warning or caution.

Safari® Books Online

Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of plans and pricing for enterprise, government, education, and individuals.

Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like Maker Media, O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hundreds more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • Make:
  • 1160 Battery Street East, Suite 125
  • San Francisco, CA 94111
  • 877-306-6253 (in the United States or Canada)
  • 707-639-1355 (international or local)

Make: unites, inspires, informs, and entertains a growing community of resourceful people who undertake amazing projects in their backyards, basements, and garages. Make: celebrates your right to tweak, hack, and bend any technology to your will. The Make: audience continues to be a growing culture and community that believes in bettering ourselves, our environment, our educational system—our entire world. This is much more than an audience, it’s a worldwide movement that Make: is leading—we call it the Maker Movement.

For more information about Make:, visit us online:

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://bit.ly/gs_with_raspberry_pi3.

To comment or ask technical questions about this book, send email to .

Acknowledgments

We’d like to thank a few people who have provided their knowledge, support, advice, and feedback to Getting Started with Raspberry Pi:

  • Patrick DiJusto
  • Brian Jepson
  • Frank Teng
  • Anna Kaziunas France
  • Marc de Vinck
  • Eben Upton
  • Tom Igoe
  • Clay Shirky
  • John Schimmel
  • Phillip Torrone
  • Limor Fried
  • Kevin Townsend
  • Ali Sajjadi
  • Andrew Rossi

1 “About Us,” Raspberry Pi Foundation.

2 Leo Kelion, “Linus Torvalds: Linux Succeeded Thanks to Selfishness and Trust,” BBC News, June 12, 2012.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset