All Projects → leech001 → MPU6050

leech001 / MPU6050

Licence: GPL-3.0 License
STM32 HAL library for GY-521 (MPU6050) with Kalman filter

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to MPU6050

fabooh
c++ template library for cortex-m0+ (lpc8xx), cortex-m0 ( lpc1114 ), cortex-m3 (bluepill), and msp430 ( small msp430 )
Stars: ✭ 28 (-75.44%)
Mutual labels:  stm32, bluepill, stm32f103c8t6
MPU60X0
Fast, Lightweight STM32 I2C HAL Driver for the MPU6000/MPU6050 IMU
Stars: ✭ 15 (-86.84%)
Mutual labels:  i2c, stm32, mpu6050
i2c-sniffer
Debugging tool for I2C networks, built for STM32 microcontrollers
Stars: ✭ 22 (-80.7%)
Mutual labels:  i2c, stm32, stm32f103c8t6
Face-Detection-and-Tracking
Computer Vision model to detect face in the first frame of a video and to continue tracking it in the rest of the video. This is implemented in OpenCV 3.3.0 and Python 2.7
Stars: ✭ 24 (-78.95%)
Mutual labels:  kalman-filter, kalman
rpi
Microcontroller projects (RPi, Arduino, ATTiny85, ESP, Pico, STM8/32)
Stars: ✭ 76 (-33.33%)
Mutual labels:  i2c, stm32
tinyfont
Text library for TinyGo displays
Stars: ✭ 37 (-67.54%)
Mutual labels:  i2c, stm32
Modbus-STM32-HAL-FreeRTOS
Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
Stars: ✭ 272 (+138.6%)
Mutual labels:  stm32, bluepill
stm32-blue-pill-rust
Rust for STM32 Blue Pill with Visual Studio Code
Stars: ✭ 98 (-14.04%)
Mutual labels:  stm32, bluepill
BlueVGA
VGA library for STM32F103C (BluePill) that can manipulate a screen with 28x30 tiles with 8x8 pixels each, in a total resolution of 224x240 pixels with 8 colors using a very low footprint
Stars: ✭ 39 (-65.79%)
Mutual labels:  stm32, bluepill
stm32 tiny monitor
A tiny external monitor for PC using STM32 and ST7789. Connects to PC over USB and displays the captured screen on ST7789 (240x240) display.
Stars: ✭ 61 (-46.49%)
Mutual labels:  stm32, bluepill
STM32-Bare-Metal
STM32F103C8 bare metal template
Stars: ✭ 26 (-77.19%)
Mutual labels:  stm32, stm32f103c8t6
HX711
HX711 driver for STM32 HAL
Stars: ✭ 34 (-70.18%)
Mutual labels:  stm32, hal
stm32 i2c to usb hid multitouch
i2c to usb hid multi touch with stm32
Stars: ✭ 55 (-51.75%)
Mutual labels:  i2c, stm32
IOsonata
IOsonata multi-platform multi-architecture power & performance optimized software library for fast and easy IoT MCU firmware development. Object Oriented design, no board package to define, just pure plug & play any boards
Stars: ✭ 40 (-64.91%)
Mutual labels:  i2c, stm32
imusensor
Python library for communication between raspberry pi and MPU9250 imu
Stars: ✭ 47 (-58.77%)
Mutual labels:  kalman-filter, kalman
versaloon
JTAG Versaloon firmware for the STM32 Bluepill board
Stars: ✭ 95 (-16.67%)
Mutual labels:  stm32, bluepill
gsm
gsm module library for STM32 LL
Stars: ✭ 28 (-75.44%)
Mutual labels:  stm32, hal
MPU-9250-Sensors-Data-Collect
MPU9250 (MPU6500 + AK8963) I2C Driver in Python for Raspbery PI
Stars: ✭ 51 (-55.26%)
Mutual labels:  i2c, mpu6050
stm32-tkg-hid-bootloader
A HID driverless bootloader and flash tool companion for the STM32F1 line
Stars: ✭ 30 (-73.68%)
Mutual labels:  stm32, bluepill
robust-kalman
Robust Kalman filter with adaptive noise statistics estimation.
Stars: ✭ 89 (-21.93%)
Mutual labels:  kalman-filter, kalman

STM32 HAL library for GY-521 (MPU6050) with Kalman filter

English note

A simple C library (STM32 HAL) for working with the GY-521 module (MPU6050) https://www.aliexpress.com/af/gy%25252d521.html?trafficChannel=af&d=y&CatId=0&SearchText=gy-521&ltype=affiliate&SortType= total_tranpro_desc & groupsort = 1 & page = 1

Start and initialize the I2C bus using the STM32CubeMX.

I2C

Configure STM32CubeMX by setting "General peripheral Initalizion as a pair of '.c / .h' file per peripheral" in the project settings.

Copy the library header and source file to the appropriate project directories (Inc, Src).

In the head file of your project (main.c), include the header file

/ * USER CODE BEGIN Includes * /
#include "mpu6050.h"
/ * USER CODE END Includes * /

add structure to the section

/ * USER CODE BEGIN PV * /
MPU6050_t MPU6050;
/ * USER CODE END PV * /

add int main (void) to the function section

/ * USER CODE BEGIN 2 * /

while (MPU6050_Init(&hi2c1) == 1);

/ * USER CODE END 2 * /

for initial initialization of the GY-521 (MPU6050).

add int main (void) to the function section

/ * USER CODE BEGIN WHILE * /
while (1)
{
/ * USER CODE END WHILE * /

/ * USER CODE BEGIN 3 * /
  MPU6050_Read_All(&hi2c1, &MPU6050);
  HAL_Delay (100);
}
/ * USER CODE END 3 * /

On this project setup is ready. After starting the program, information from the GY-521 (MPU6050) will be available through the MPU6050 structure

MPU6050.KalmanAngleX

The Kalman filter algorithm for calculating angles is taken from the project https://github.com/TKJElectronics/KalmanFilter

Russian note

Простая библиотека на Си (STM32 HAL) для работы с модулем GY-521 (MPU6050) https://www.aliexpress.com/af/gy%25252d521.html?trafficChannel=af&d=y&CatId=0&SearchText=gy-521&ltype=affiliate&SortType=total_tranpro_desc&groupsort=1&page=1

Запустите и инициализируйте шину I2C c помощью STM32CubeMX.

I2C

Сконфигурируйте STM32CubeMX установив "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" в настройках проекта.

Скопируйте заголовочный и исходный файл библиотеки в соотвесвтующие директории проекта (Inc, Src).

В головном файл вашего проекта (main.c) подключите заголовочный файл

/* USER CODE BEGIN Includes */
#include "mpu6050.h"
/* USER CODE END Includes */

в секцию добавьте структуру

/* USER CODE BEGIN PV */
MPU6050_t MPU6050;
/* USER CODE END PV */

добавьте в секцию функции int main(void)

/* USER CODE BEGIN 2 */

while (MPU6050_Init(&hi2c1) == 1);

/* USER CODE END 2 */

для начальной инициализации GY-521 (MPU6050).

добавьте в секцию функции int main(void)

/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
  MPU6050_Read_All(&hi2c1, &MPU6050);
  HAL_Delay(100);
}
/* USER CODE END 3 */

На этом настройка проекта готова. После запуска программы информация от GY-521 (MPU6050) будет доступна через структуру MPU6050

MPU6050.KalmanAngleX

Алгоритм фильтра Калмана для расчета углов взят из проекта https://github.com/TKJElectronics/KalmanFilter

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].