Programming the LCD with the I2C LCD module

Before writing the program, we first need to enable the I2C protocol from the Raspberry Pi configuration. To do this, open the command window and type in the following command:

sudo raspi-config

Inside configurations, open Interfacing Options, shown as follows:

Next, open the I2C option, as shown in the following screenshot:

Select the Yes option and press Enter to enable I2C, as follows:

After enabling ...

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.