Free Book Online
Book Raspberry Pi IoT In C


Raspberry Pi IoT In C

3.4 (2128)

Log in to rate this item

    Available in PDF - DJVU Format | Raspberry Pi IoT In C.pdf | Language: ENGLISH
    Harry Fairhead(Author)

    Book details

The Raspberry Pi makes an ideal match for the Internet of Things. But to put it to good use in IoT you need two areas of expertise, electronics and programming and because of the way hardware and software engineering tend to occupy separate niches you may need help with combining the two. This book teaches you to think like an IoT programmer.

In Raspberry Pi IoT in C you will find a practical approach to understanding electronic circuits and datasheets and translating this to code, specifically using the C programming language. The main reason for choosing C is speed, a crucial factor when you are writing programs to communicate with the outside world. If you are familiar with another programming language, C shouldn't be hard to pick up. Here it is used in conjunction with NetBeans and with the bcm2835 library.

The main idea in this book is to not simply install a driver, but to work directly with the hardware. So rather than using Raspberry Pi HATs or other expansion boards we use the Pi's GPIO (General Purpose Input Output) and connect off-the-shelf sensors. If you want to know how to work with the GPIO lines directly, how to work with near realtime Linux and generally take control of the Pi this is the book you need. It explains how to use the standard bus types - SPI, I2C, PWM - and with custom protocols including an in-depth exposition of the 1-wire bus. You will also discover how to put the Internet into the IoT using sockets and the low cost ESP8266.

After reading this book you will be in a better position to tackle interfacing anything-with-anything without the need for custom drivers and prebuilt hardware modules.

Having written a Blinky program to check that everything we need is installed and working we move on to exploring the basics of using the GPIO and also master memory mapping, pulse width modulation and other more sophisticated bus types. From here we can start connecting sensors, which is a core requirement for IoT. First we’ll meet the ubiquitous I2C bus, next we’ll implement a custom protocol for a one-wire bus, and eventually we’ll add eight channels of 12-bit AtoD with the SPI bus, which involves overcoming some subtle difficulties. Next we look at the traditional serial interface how to use it to communicate with other devices. This paves the way for getting the Pi on the web – after all this is a book about the Internet of Things -using first a USB WiFi adapter and sockets and then the low cost ESP8266, which is particularly useful with the Pi Zero which has only one USB port. Having transformed the Pi into both a web client and a web server we can then use them to exchange information.

Harry Fairhead has been working with microprocessors, and electronics in general, for many years. He is author of Explore Intel Edison, micro:bit IoT in C and The 386/486 Personal Computer: A Power User's Guide. He is editor of and a regular contributor to, where he covers all aspects of hardware.

3.4 (9783)
  • Pdf

*An electronic version of a printed book that can be read on a computer or handheld device designed specifically for this purpose.

Formats for this Ebook

Required Software Any PDF Reader, Apple Preview
Supported Devices Windows PC/PocketPC, Mac OS, Linux OS, Apple iPhone/iPod Touch.
# of Devices Unlimited
Flowing Text / Pages Pages
Printable? Yes

Book details

  • PDF | 292 pages
  • Harry Fairhead(Author)
  • I/O Press; 1 edition (October 2, 2016)
  • English
  • 9
  • Computers & Technology

Read online or download a free book: Raspberry Pi IoT In C


Review Text

  • By Glenn A. Miller on February 3, 2017

    I'm likely to improve upon my rating as I work through this book, but the lack of attention to editing makes the first several pages read a mess."If it does upgrade to a Pi 2/3." - Page 13, Paragraph 2. A comma would be most helpful here and in several places in the text before it. Programming is all about paying attention to syntax and readability.The same is true of the English language. If you ever make it to a second edition, please get a decent editor to correct these errors so one can read it without having to go back and reconstruct the meaning. It breaks all rhythm.

  • By Gyz on October 30, 2017

    Good step-by-step introduction to developing on and for the raspberry pi. I have looked at a number of programming languages available for the Pi, and for me C is the best.

  • By dognort on March 28, 2017

    I'm in the process of completing an AS ECET degree and had to take a C class. Now I'm hooked on these small appliance devices.

  • By Sander Boersma on February 17, 2018

    I leart alot from this book!! Very glad i have it!

  • Name:
    The message text*: