Welcome to Jetson Orin NANO Developer Kit repository
06.I2C communication
I2C Communication
I2C Communication1. GPIO Pin Diagram2. I2C Test2.1. Install Dependencies2.2. I2C Devices2.2.1. Query the I2C Bus2.2.2. Query the I2C Device2.3. Run the Program3. Experiment Effect
pip Installation Note: Ubuntu 24.04 marks the system Python as "externally managed" according to PEP 668, so installing directly with pip may report
externally-managed-environment.--break-system-packagesallows pip to install packages in that environment; a virtual environment usually does not need this parameter, but this tutorial keeps it to keep the commands consistent.
1. GPIO Pin Diagram
Use a 0.91-inch OLED to test the I2C communication function, and connect it according to the wiring below:
Note: Do not connect the pins incorrectly or cause a pin short circuit; a mistake may damage the mainboard hardware!

2. I2C Test
2.1. Install Dependencies
sudo pip3 install smbus --break-system-packagessudo pip3 install Adafruit_SSD1306 --break-system-packages

2.2. I2C Devices
During normal development, you need to find the device bus to which the I2C device is mounted and the device address.
2.2.1. Query the I2C Bus
Enter the following command in the terminal to list all buses of the device:
xxxxxxxxxxi2cdetect -l
2.2.2. Query the I2C Device
Enter the following command in the terminal to list the I2C devices under the specified bus: the I2C address corresponding to the oled is 0x3c
xxxxxxxxxxi2cdetect -y -r *

2.3. Run the Program
oled_i2c.py is not included in the jetson-gpio library:
xxxxxxxxxxcd ~/jetson-gpio/samples/
xxxxxxxxxxpython3 oled_i2c.py
3. Experiment Effect
After the program is started, the OLED displays system information such as the system CPU usage, the system time, and the memory usage:

