• Complain

Gay - Exploring the Raspberry Pi 2 with C++

Here you can read online Gay - Exploring the Raspberry Pi 2 with C++ full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA;New York, year: 2015, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Gay Exploring the Raspberry Pi 2 with C++
  • Book:
    Exploring the Raspberry Pi 2 with C++
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2015
  • City:
    Berkeley;CA;New York
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Exploring the Raspberry Pi 2 with C++: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Exploring the Raspberry Pi 2 with C++" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

This book takes you on a tour of the Pi 2 hardware and all of the fantastic things that you can do to create innovative and useful projects with your Pi. Start with creating a workstation that does actual work, and move into installing a custom kernel, creating a clock, learning the ins and outs of the GPIO interface, and pick up some useful C++ skills along the way. You will learn: how to create an experimenters workstation for the Pi 2, complete with breadboard and Arduino; details of GPIO, including a custom command for working with it; useful projects like a general purpose clock and the PiSpy; quick intro to C++ for the Pi; how to make a multi-core webserver. --;Chapter 1: Introduction to Pi 2 -- Chapter 2: Workstation -- Chapter 3: The Matrix -- Chapter 4: Installing a Kernel -- Chapter 5: GPIO gp Command -- Chapter 6: General Purpose Clock -- Chapter 7: Pulse Width Modulation -- Chapter 8: Physics of the GPIO Interface -- Chapter 9: PiSpy -- Chapter 10: Debouncing -- Chapter 11: Fast Track to C++ -- Chapter 12: Multi-core Webserver -- Appendix A: GPIO Class, Part I -- Appendix B: GPIO Class, Part II -- Appendix C: GPIO Class, Part III -- Appendix D: MAX7219 Class -- Appendix E: Matrix Class -- Appendix F: MTop and Diskstat -- Appendix G: The Rest.

Gay: author's other books


Who wrote Exploring the Raspberry Pi 2 with C++? Find out the surname, the name of the author of the book and a list of all author's works by series.

Exploring the Raspberry Pi 2 with C++ — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Exploring the Raspberry Pi 2 with C++" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Warren Gay 2015
Warren Gay Exploring the Raspberry Pi 2 with C++ 10.1007/978-1-4842-1739-9_1
1. Introduction
Warren Gay 1
(1)
Ontario, Canada
The introduction of the Raspberry Pi 2 has ushered in exciting new opportunities. No longer is the software limited to one CPU core, but now executes on four. Memory has been doubled to 1 GB, providing a larger disk cache and resulting in better SD card performance. This also leaves room for larger applications. Having four built-in USB ports is also helpful in avoiding the need for a USB hub.
Some things have changed underneath the hood as well, like the physical address for peripherals. The address BCM2708_PERI_BASE has changed from 0x20000000 to 0x3F000000 for the Raspberry Pi 2. This means that a lot of software written for the earlier Raspberry Pi models will not work on the new Pi 2 without changes. With device tree (DT) support built into Raspbian Linux, it is now a simple matter to automatically detect this. Consequently, the included librpi2 GPIO class detects this automatically.
The main purpose in this book is to exploit the Raspberry Pi 2. To that end, this book comes with software libraries and tools to make doing things on your Pi easier. The provided C++ libraries will make it possible to access the GPIO and other peripherals with only a few lines of code. Command line tools like the gp command will give you simple and ready access to list your GPIO state and to make changes. A useful feature of gp includes the ability to blink a pin, so that you can verify wiring with an LED attached. The gp command also allows a pin to be monitored for changes, making testing inputs easier. All installed tools include their own self-help display (command option -h).
A Raspberry Pi designer is handicapped without a logic analyzer for tracing events on GPIO pins. For this reason, I felt strongly that the reader should have one to use. This book provides you with a software-based logic analyzer for free (it requires no extra hardware). The PiSpy logic analyzer is able to see all GPIO inputs and outputs and record events to a file. The GtkWave utility is used to display the captured events graphically.
The C++ programming language was chosen for this book to make your life easier. The C programmer need not fear this because Ive kept to the basics without using hairy language elements. Many Arduino students use C++ every day without knowing it. The C++ standardization efforts of the last decade have had a very positive effect on g++ and glibc. This and the availability of the Standard Template Library (STL) in glibc make it a very productive environment in which to program.
Ive used a hybrid approach to the C++ code presented. I continue to use the well-understood standard I/O (stdio) routines like printf() so that the code is easy to read and familiar. I know that C++ purists will tsk tsk about this, but this is a practical book rather than a computer science text.
Of particular interest, are the included software utilities and the C++ library librpi2. Tools and libraries are most useful when you have the documentation in your hands.
Overview
presents a simple Raspberry Pi 2 workstation construction project. Using a short plank of wood, you can mount your Raspberry Pi 2 and a breadboard on it. I find that being organized this way helps considerably.
presents The Matrix construction project. It uses an LED matrix to produce a display that can provide instant display of CPU utilization for each of its cores. It also displays bar graphs for memory and disk I/O utilization. If you dont want to construct this project, you can install the htop utility instead.
cover an exciting tool that is also included in the books software, the PiSpy logic analyzer tool. This provides a simple-to-use logic analyzer for your Pi, requiring no additional hardware. It allows you to inspect and capture GPIO signal events, whether the GPIO is an input or output. Through the use of the direct memory access (DMA) peripheral, PiSpy can capture signal changes up to about 12 MHz. The GtkWave command is then optionally invoked automatically to display the captured data.
is dedicated to the GPIO gp command. All utilities provided with this book use proper command line option processing as used by the standard Unix commands. The chapter begins with a brief discussion of what Unix command line conventions are and then works through the gp command use cases with explanations.
introduces the piclk utility, which can display or alter the configuration of the general purpose clock (or PWM clock). Experiments with the clock are included.
expands on the clock concept by examining the Pulse Width Modulation (PWM) peripheral. The pipwm utility and its options are explored in combination with PiSpy. PiSpy illustrates the effect of different configuration settings.
takes a light look at what GPIO is and the Complementary MOS (CMOS) technology that it is made from. Electronics students will find the examination helpful in explaining what CMOS is and avoiding some pitfalls in interfacing. Additionally CMOS inputs are examined with a brief discussion of chip static protection schemes.
provides a detailed look at the PiSpy logic analyzer and describes the various features of its application.
looks at GPIO input processing, focusing particularly on the problem of debouncing input signals from buttons and switches.
is a software-focused chapter. It provides a fast track to using C++ and the STL in a very easy and pragmatic way. The STL provides the programmer great benefits in programming time and reliability. In this chapter we look at the most popular containers and example code fragments are provided throughout.
is the multithreaded software designed to take advantage of all four CPU cores within an efficient web server. The server is based on the libevent library behind the scenes, but C++ classes are used to provide a very simple interface. This allows you to build and customize your own web server with very little mainline code. The provided piweb project can be used and extended.
Appendixes A through C document the librpi2 C++ classes for programming GPIO. With the provided library, it is a simple matter to directly control GPIO from your own code. The appendixes provide you with easy-to-follow documentation and examples for the various class methods supported.
Appendixes D and E describe some other C++ classes that might be useful for people wanting to work with Matrix or 7-segment displays. describes classes that have to do with gathering system performance metrics as used by the mtop utility.
provides some additional information about some of the remaining advanced classes found in librpi2.
Software for This Book
You will want to download the open source software written for this book. It is available from two sources:
  • www.apress.com/9781484217382
  • https://github.com/ve3wwg/raspberry_pi2.git
The open source software is important because:
It provides you with several utilties: gp, piclk, pipwm, mtop, and PiSpy.
It includes the piweb C++ web server project.
It provides library librpi2, which can be used in your own C++ projects.
If you are using git to download the source code use the command
$ git clone https://github.com/ve3wwg/raspberry_pi2.git ./pi2
The second argument tells git to install the source code into the new pi2 subdirectory.
The gp command provides you with a first-class Unix utility to display and control the GPIO resources. This utility also includes some useful options to blink a GPIO pin, which is great for checking wiring to LEDs. Another option allows you to monitor an input to the terminal session, so you can check input wiring and so on.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Exploring the Raspberry Pi 2 with C++»

Look at similar books to Exploring the Raspberry Pi 2 with C++. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Exploring the Raspberry Pi 2 with C++»

Discussion, reviews of the book Exploring the Raspberry Pi 2 with C++ and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.