Jetson Nano I2C Communication Tutorial

The I2C pin of the Jetson nano is shown in the figure, and the I2C service needs to be enabled before use.

Firstly, install I2Ctool, and input the terminal as follows:

Check the installation status, terminal input:

The following output indicates successful installation

Scan all i2c devices on a certain bus and print out the device i2c bus address. For example, if a device with address 0x0f is mounted on the I2C pin, the corresponding device I2C address will be displayed

Smbus is a Python library. If smbus is not installed, the terminal input is:

The Smbus protocol has many related library functions that can be used for I2C communication

 

The following is a program case of our store's OLED module. If testing is needed, the corresponding OLED module should be used (you can choose to change the OLED module in our store)

Wiring:

Jetson Nano pin 3(SDA)→oled module SDA

Jetson Nano J pin 5(SCL)→oled module SCL

Jetson Nano J pin 2(5V)→oled module VCC

Jetson Nano J pin 6(GND)→oled module GND

Import Adafruit_ SSD1306 library This is the OLED library, and you need to download this library when using your own image

Initialize oled:

Afterwards, if you are interested in reading some basic information functions of nano, you can go to this py file to learn more, which includes obtaining local IP, tf card space usage, memory usage, system time, and other information.

Terminal input:

Experimental phenomenon: