LSM6DSOX + Raspberry Pi Pico 2 + SPI: Motion Sensor Tutorial (SPI Setup + Code Walkthrough)
Автор: Code on the Edge
Загружено: 2025-08-03
Просмотров: 381
Описание:
🌀 LSM6DSOX (IMU) + Raspberry Pi Pico 2 | SPI Walkthrough, C/C++ Code & Datasheet Deep Dive
In this video, I walk you through how to interface the LSM6DSOX 6-axis IMU with the Raspberry Pi Pico 2 using SPI communication. We go step-by-step through my C/C++ code, referencing the LSM6DSOX datasheet along the way so you understand exactly what each register and setting does.
To make things even clearer, I use my Digilent Logic Analyzer to capture and visualize the SPI transactions in real time—so you can see what’s really happening on the wires.
Whether you're just getting started with embedded systems or diving deeper into SPI protocol and sensor integration, this is a practical walkthrough to help you understand both the code and the hardware-level details.
📌 What You’ll Learn:
Setting up SPI on the Raspberry Pi Pico
Initializing and configuring the LSM6DSOX
Reading accelerometer and gyroscope data
How to interpret register settings from the datasheet
Analyzing SPI data using a logic analyzer
🔧 Tools Used:
Raspberry Pi Pico 2: https://www.adafruit.com/product/6328
ST LSM6DSOX IMU: https://www.adafruit.com/product/4438...
Digilent Logic Analyzer + WaveForms: https://digilent.com/shop/analog-disc...
C/C++ (Pico SDK): https://datasheets.raspberrypi.com/pi...
LSM6DSOX Datasheet: https://www.st.com/resource/en/datash...
👨💻 Code Repo: https://github.com/code-on-the-edge/r...
Chapters:
0:00 Intro
0:39 Setup / Create New Project
1:46 Including Libraries
2:08 main() Function
2:25 SPI Defines
4:05 SPI Initializtation Function
6:28 SPI Read Function
10:25 SPI Write Function
12:42 LSM6DSOX Configuration Registers
13:56 WHO_AM_I Register
14:37 Breadboard Connections
16:53 Compile Project
17:22 How to Flash Pico with Program
18:15 Minicom installation & Set up
18:47 Fixing 2 bugs
19:18 Analyzing WHO_AM_I Register SPI Transaction
20:22 Accelerometer Control Register 1, CTRL1_XL
21:47 Gyroscope Control Register 2, CTRL2_G
22:52 Control Register 3
23:30 Analyzing Control Register SPI Transaction
25:28 Gyroscope & Accelerometer Registers in Datasheet
26:43 imu_read() Function
27:07 Reading Raw Gyroscope & Accelerometer Data
29:58 Convert Raw Data into int16_t
31:00 Convert Raw int16_t Data into Physical Units
33:36 Analyzing Gyroscope & Accelerometer Data on Serial Terminal
34:02 Analyzing Earth Gravitational Force on Accelerometer
34:43 Analyzing Rotational Speed on Gyroscope
35:52 Shaking LSM6DSOX Sensor
36:15 Outro
#RaspberryPiPico #LSM6DSOX #EmbeddedSystems #SPI #IMU #LogicAnalyzer #Digilent #cpp #SensorFusion #CodeOnTheEdge #cprogramming
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: