Using I2C on Jetson Nano with Python

Is there any reference material on how to use Nano’s I2C bus with Python? I saw i2cdev for TX1/TX2 but

import i2cdev

does not work in Nano.

import io
io.open ("/dev/i2c-0")

seems to work but there is no documentation for the rest. Any help will be appreciated.

hello rasid.pac,

you might refer to https://www.instructables.com/id/Raspberry-Pi-I2C-Python/ for some examples.
thanks

Okay thanks, I guess the key was

sudo usermod -a -G i2c $USER

because previously

import smbus

returned “No module named smbus”. Now, it works.

1 Like