Hi,
I’ll share how to use these I2C sensors in python with Radxa zero.
OS:
Official Debian (Linux radxa-zero 5.10.69-9-amlogic-g7c418f844e4b)
Qwiic connector:
SparkFun Qwiic SHIM for Raspberry Pi (https://www.sparkfun.com/products/15794)
Raspberry Pi QWIIC connector and cable (https://ozzmaker.com/product/raspberry-pi-qwiic-connector-and-cable/)
Sensor:
some sensor
- Enable I2C
Add overlay in /boot/uEnv.txt.
overlays=meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15
If you want to turn on several functions, use a space as a delimiter.
overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1 meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15 meson-g12a-spi-spidev
- Connect sensor and boot
Check if /dev/i2c-3 exists.
- Install package
$ sudo apt install python3-libgpiod
For example, Adafruit BMP388 Precision Barometric Pressure and Altimeter
$ sudo pip3 install adafruit-circuitpython-bmp3xx
- Quick hack
$ sudo vim /usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py
Line 127
#alias = get_dts_alias(“ffd1d000.i2c”) #comment out this line
alias = get_dts_alias(“ffd1c000.i2c”) #add this line
Then, you can use many sensors available with qwiic ecosystems!
Many sensors are supported in adafruit circuitpython.
I finally got to work with I2C sensor, GPS and SPI display (MIP reflective display) as same as Raspberry Pi Zero.
I can start working on improving my bike computer.