Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi Zero Cookbook

You're reading from  Raspberry Pi Zero Cookbook

Product type Book
Published in Mar 2017
Publisher Packt
ISBN-13 9781786463852
Pages 422 pages
Edition 1st Edition
Languages

Table of Contents (17) Chapters

Raspberry Pi Zero Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Kick-Start Your Raspberry Pi Zero Setting Up Physical and Wireless Connections Programming with Linux Programming with Python Getting Your Hands Dirty Using the GPIO Header Controlling the LEDs and Displays Controlling the Hardware Taking Digital Inputs to the Raspberry Pi Zero Interfacing Sensors with the Raspberry Pi Zero Cooking up Projects to Amaze the World!

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...

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 $15.99/month. Cancel anytime}