In this guide we will show how to get the a BerryIMUv3 working with a Raspberry Pi Pico, using MicroPython. This code example supports I2C and SPI.
Hook up GuideThe two schematic images attached to this project show how to hook up the BerryIMUv3 via I2C or SPI. (If using SPI, you will need to place a solder "blob" on JP7 on the BerryIMUv3 to complete the SPI connection, as shown below
The MicroPython code can be downloaded from our GitHub repository. The code for this example can be found under the PicoMicroPython directory.
We will be using Thonny to program the Raspberry Pi Pico.
If you are new to the Raspberry Pi Pico and Thonny, we suggest viewing these excellent tutorials from our friends at Core Electronics;1. Getting started with Raspberry Pi Pico2. Pico and Thonny
The sample code supports both I2C and SPI communications. Comment out the protocol which will not be used as shown below. Below we have commented out I2C as we will be using SPI
import utime
import math
from LSM6DSL import *
import machine
#Comment out one of the below lines
import IMU_SPI as IMU
#import IMU_I2C as IMU
Comments
Please log in or sign up to comment.