This gist contains a simple example of the WaveShare Pico 10DOF IMU sensor module for RaspberyPi Pico using the Adafruit CircuitPython libraries instead of the chaotic WaveShare example code.
You need to setup your RaspberryPi Pico to run CircuitPython by:
This example uses the following Adafruit libaries within CircuitPython:
After downloading the libraries, we need to grab the following libraries and copy them to your Pico (now named & mounted as 'CIRCUITPY') /lib
folder:
/adafruit_bus_device
/adafruit_register
adafruit_icm20x.mpy
adafruit_lps2x.mpy
Once you've copied them over, you can utilise the code.py
below and run the example which prints a steady stream of data from the sensors as shown below:
Acceleration: X:0.14, Y: -0.14, Z: 10.07 m/s^2
Gyro X:-0.02, Y: 0.02, Z: -0.01 rads/s
Magnetometer X:-7.50, Y: 14.85, Z: -96.60 uT
Pressure: 1001.28 hPa
Temperature: 21.59 C
Acceleration: X:0.11, Y: -0.12, Z: 10.18 m/s^2
Gyro X:-0.03, Y: 0.02, Z: -0.01 rads/s
Magnetometer X:-7.50, Y: 14.40, Z: -95.85 uT
Pressure: 1001.25 hPa
Temperature: 21.59 C
Acceleration: X:0.15, Y: -0.11, Z: 10.11 m/s^2
Gyro X:-0.02, Y: 0.02, Z: -0.00 rads/s
Magnetometer X:-8.25, Y: 15.15, Z: -94.80 uT
Pressure: 1001.28 hPa
Temperature: 21.59 C
Enjoy!