ICM20948 - pimoroni_i2c object has no attribute write_byte_data

I am using a Pico Explore Basewith a Raspberry Pi Pico W running the latest MicroPython v1.21.0, picow v1.21.0 on 2023-10-06 from github => pimoroni => pimoroni-pico => releases.

I have been successful at getting the BH1745 and BME688 Breakouts Boards running using the ‘embedded’ breakout_bme68x and breaklout_bh1745 modules. I have also been successful at getting the Pimoroni ICM20948 Breakout Board running with CircuitPython 8.2.8 when connected using the onboard Stemma/QT connector. So I know that I have a good ICM20948 chip.

However, there is not an embedded ICM20948 breakout module included in the Pimoroni Pico Explorer MicroPython build (Issue #15). And I have not been successful at getting Pimoroni’s ICM20948 python driver working with the Pico Explorer Base build of MicroPython either.

This code (example code from the driver’s repo):

import time
from pimoroni_i2c import PimoroniI2C
from icm20948 import ICM20948
from pimoroni import PICO_EXPLORER_I2C_PINS

I2C = PimoroniI2C(**PICO_EXPLORER_I2C_PINS)
icm = ICM20948(104,I2C)

while True:
    x, y, z = icm.read_magnetometer_data()
    ax, ay, az, gx, gy, gz = icm.read_accelerometer_gyro_data()
    print("""
Accel: {:05.2f} {:05.2f} {:05.2f}
Gyro:  {:05.2f} {:05.2f} {:05.2f}
Mag:   {:05.2f} {:05.2f} {:05.2f}""".format(
        ax, ay, az, gx, gy, gz, x, y, z
        ))
    time.sleep(0.25)

Produces this error:

\'pimoroni_i2c\' object has no attribute \'write_byte_data\

I was able to get past the initialization error where I kept getting errors that tried to run exception code in the driver that needed to import smbus (which is not present) by fixing the way that the I2C bus was being initiated in the original example code. So it now looks like I have a valid instance of the ICM20948 object that the above code is trying to work with.

I am running into similar issues getting the Pimoroni PA1010D Breakout board up and running on the Pico Explorer as well. That drive is also needing to import smbus. Seems like when there are embedded drivers for breakout boards, everything just works perfectly. If not…

Are Pimoroni’s stand-alone libraries for various Breakout Boards compatible with the build of MicroPython that was custom-built for the Pico Explorer board?

Just looking for a way to get the Pimoroni ICM20948 9DoF Motion Sensor Breakout Board to work with the Pimoroni Pico Explorer Base running MicroPython on a Pico W.