What is the I2C protocol?

The I2C protocol is used in many electronic devices. We use it to connect one master device to multiple slave devices, or multiple master devices to multiple slave devices. The main advantage of the I2C protocol is that the master needs only two pins to communicate with multiple slave devices.

In an I2C bus, all devices are connected in parallel to the same two-wire bus. We can connect a total of 128 devices using 7-bit addressing, and a total of 1,024 devices using 10-bit addressing, as shown in the following diagram:

Each device connected using the I2C protocol has a unique ID, which makes it possible to communicate ...

Get Hands-On Robotics Programming with C++ 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.