Book Image

Raspberry Pi Zero Cookbook

Book Image

Raspberry Pi Zero Cookbook

Overview of this book

The Raspberry Pi Zero, one of the most inexpensive, fully-functional computers available, is a powerful and revolutionary product developed by the Raspberry Pi Foundation. The Raspberry Pi Zero opens up a new world for the makers out there. This book will give you expertise with the Raspberry Pi Zero, providing all the necessary recipes that will get you up and running. In this book, you will learn how to prepare your own circuits rather than buying the expensive add–ons available in the market. We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the Raspberry Pi Zero with sensors, motors, and other hardware. You will also get hands-on with interesting projects in media centers, IoT, and more.
Table of Contents (17 chapters)
Raspberry Pi Zero Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Basics of I2C and checking the I2C devices present on a port


I2C is an interface mode on the Raspberry Pi's GPIO that allows communication with all kinds of peripherals. We will be using one of these later on in this chapter when we transmit radio signals. This recipe will show you how to set it up and test it.

Getting ready

The easiest way to configure the use of the I2C interface is with raspi-config. Enter sudo raspi-config and select Interfacing Options. Option P5 will set up I2C communication. Select Enable, reboot, and you are ready to begin. Older versions of Raspbian have I2C in the Advanced Options Menu, as shown below:

Finding I2C in older Raspbian versions

The newer releases of Raspbian have an Interface Menu, where you will find the I2C settings:

How to do it...

After enabling I2C and rebooting your Raspberry Pi, take a look at the device list:

pi@rpz14101:~ $ sudo ls /dev/*i2c*
/dev/i2c-1

Installing i2ctools will give you a few more options when working with the I2C interface...