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