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:

Getting ready

Finding I2C in older ...

Get Raspberry Pi Zero Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.