Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi Computer Architecture Essentials

You're reading from  Raspberry Pi Computer Architecture Essentials

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781784397975
Pages 232 pages
Edition 1st Edition
Languages
Authors (2):
Andrew K. Dennis Andrew K. Dennis
Profile icon Andrew K. Dennis
Teemu O Pohjanlehto Teemu O Pohjanlehto
Profile icon Teemu O Pohjanlehto
View More author details
Toc

Table of Contents (18) Chapters close

Raspberry Pi Computer Architecture Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Introduction to the Raspberry Pi's Architecture and Setup 2. Programming on Raspbian 3. Low-Level Development with Assembly Language 4. Multithreaded Applications with C/C++ 5. Expanding on Storage Options 6. Low-Level Graphics Programming 7. Exploring the Raspberry Pi's GPIO Pins 8. Exploring Sound with the Raspberry Pi 2 9. Building a Web Server 10. Integrating with Third-Party Microcontrollers 11. Final Project Index

Preface

Are you interested in the myriad features of your Raspberry Pi 2? From the hardware to the software, do you wish to understand how you can interact with these features?

Then this is the book for you!

The Raspberry Pi 2 is one of the latest hardware offerings in the Raspberry Pi family. With many new and improved features than previous versions, there is so much more an enthusiast can do.

This book will walk you through how you can get the most out of your device.

You will learn about how to program on the Raspberry Pi using the Assembly language, Python, and C/C++. This will include building a web server in Python and saving data to an SQLite database. Ever wondered what threads are? These are covered here too.

In addition to this, you will explore the various types of GPIO pins and how these can be used to interact with third party microcontrollers and electronic circuits.

The sound and graphics capabilities of the Raspberry Pi 2 are also experimented with through a number of projects. And to expand the Raspberry Pi's storage option, we will also set up an external HDD via USB.

Finally, the book concludes with a project that brings together many of the technologies explained throughout the chapters.

By the time you finish reading this book, you'll have a firm knowledge of the Raspberry Pi 2 and how you can devise your own projects that use its capabilities.

What this book covers

Chapter 1, Introduction to the Raspberry Pi's Architecture and Setup, provides an introduction to the Raspberry Pi and its hardware architecture. We will explore the various hardware components in detail, and this will provide a basis for the programming projects in future chapters. A quick guide to getting Raspbian installed and SSH enabled is also provided.

Chapter 2, Programming on Raspbian, provides an introduction to the programming languages used in this book. An explanation will be provided of which language is used and why. This chapter will also guide you through setting up the tools for Assembler, C/C++, and Python. Three introduction programs will then be walked through to give you the opportunity to test that your setup works.

Chapter 3, Low-Level Development with Assembly Language, explores programming in the Raspbian operating system using the Assembler programming language.

Chapter 4, Multithreaded Applications with C/C++, having looked at Assembler, we move up the programming hierarchy to C/C++. We learn how to write multithreaded applications and understand their usefulness. Through these applications, we learn more about the multi-core CPU of the Raspberry Pi 2.

Chapter 5, Expanding on Storage Options, offers a guide to expanding the storage options of the Raspberry Pi beyond the SD card.

Chapter 6, Low-Level Graphics Programming, shows you how to interact with the graphics hardware on the Raspberry Pi 2. Here you will learn how to draw to the screen via the frame buffer.

Chapter 7, Exploring the Raspberry Pi's GPIO Pins, shows you how to interact with electronic components using the Raspberry PI's GPIO pins. Here we look at how Python libraries can be used to simplify the process.

Chapter 8, Exploring Sound with the Raspberry Pi 2, gives an introduction to the basics of sound programming using the Raspberry Pi's hardware. Learn about live coding via the Sonic-Pi IDE to generate your own algorithmic music.

Chapter 9, Building a Web Server, expands upon your knowledge of Python to build a web server via Flask. This chapter explores the Ethernet and Wi-Fi capabilities of the Raspberry Pi for delivering web-based applications. In this chapter, you will also learn about using SQLite to store data and display it via a web page. Topics covered also include Apache and NGINX.

Chapter 10, Integrating with Third-Party Microcontrollers, in this chapter we learn how to interact with third-party microcontrollers such as the Arduino. These devices can form the basis of robotics projects and augment the abilities of the Raspberry Pi.

Chapter 11, Final Project, will conclude the book with a final project that brings together many of the topics explored throughout previous chapters.

What you need for this book

The following list provides an overview of the recommended and optional hardware needed for the projects in this book. Where hardware is needed for a specific chapter, the relevant chapter is listed:

  • Raspberry Pi 2.

  • USB keyboard.

  • HDMI monitor.

  • USB mouse.

  • MicroSD card.

  • Wall power unit for the Raspberry Pi 2.

  • A working Internet connection.

  • A selection of wires for connecting to the GPIO pins; 12 recommended for Chapter 7, Exploring the Raspberry Pi's GPIO pins, Chapter 10, Integrating with Third-Party Microcontrollers, and Chapter 11, Final Project.

  • An LED for Chapter 7, Exploring the Raspberry Pi's GPIO pins and Chapter 11, Final Project.

  • 1.6K, 3.3k Ohm resistor for Chapter 10, Integrating with Third-Party Microcontrollers.

  • 270 Ohm resistor for Chapter 7, Exploring the Raspberry Pi's GPIO pins and Chapter 11, Final Project.

  • USB hard drive for Chapter 5, Expanding on Storage Options.

  • Cooking Hacks Raspberry Pi to Arduino Bridge Shield or Pi Cobbler. These are optional and not necessary, as the breadboard can replace these.

  • Breadboard. Only required if not using a third-party shield. Needed for Chapter 7, Exploring the Raspberry Pi's GPIO pins, Chapter 10, Integrating with Third-Party Microcontrollers, and Chapter 11, Final Project.

  • Arduino Uno. Needed for Chapter 10, Integrating with Third-Party Microcontrollers.

  • USB cable to connect Arduino to Raspberry Pi. Needed for Chapter 10, Integrating with Third-Party Microcontrollers.

Who this book is for

Are you interested in the architecture that forms the Raspberry Pi 2? Would you like to learn how its components work through interactive projects?

This book provides a hands-on guide to the Raspberry Pi 2's hardware and software. Each chapter builds upon the last to develop applications and electronics that leverage many of the features of the Raspberry Pi 2. From programming sound to integrating with third party microcontrollers, it's all covered here.

Aimed at the Raspberry Pi enthusiast, this is a perfect introductory text on how to get the most out of your new device.

While understanding programming concepts is helpful, no prior knowledge of the programming languages covered in this book is required.

Some simple electronics projects are included but no soldering is required.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The cd command allows you to change directories."

A block of code is set as follows:

int main(void)
{
int a;
printf("Please input an integer: ");
scanf("%d", &a);
printf("You entered the number: %d\n", a);
return 0;
}

Any command-line input or output is written as follows:

mv /home/pi/test.txt /home/pi/test2.txt

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on the Generate button."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.

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 ₹800/month. Cancel anytime}