{"id":47264272,"url":"https://github.com/leech001/MPU6050","last_synced_at":"2026-03-29T08:00:52.955Z","repository":{"id":37426427,"uuid":"221422010","full_name":"leech001/MPU6050","owner":"leech001","description":"STM32 HAL library for GY-521 (MPU6050) with Kalman filter","archived":false,"fork":false,"pushed_at":"2023-09-17T18:34:19.000Z","size":1398,"stargazers_count":439,"open_issues_count":5,"forks_count":87,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-25T18:06:15.425Z","etag":null,"topics":["blackpill","bluepill","gy-521","hal","i2c","kalman","kalman-filter","mpu6050","peripheral","stm32","stm32f103c8t6","stm32f401ccu6"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leech001.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-13T09:31:21.000Z","updated_at":"2025-05-24T10:03:33.000Z","dependencies_parsed_at":"2024-11-24T08:01:05.136Z","dependency_job_id":null,"html_url":"https://github.com/leech001/MPU6050","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leech001/MPU6050","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leech001%2FMPU6050","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leech001%2FMPU6050/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leech001%2FMPU6050/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leech001%2FMPU6050/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leech001","download_url":"https://codeload.github.com/leech001/MPU6050/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leech001%2FMPU6050/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31136696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-29T07:35:32.000Z","status":"ssl_error","status_checked_at":"2026-03-29T07:30:10.597Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blackpill","bluepill","gy-521","hal","i2c","kalman","kalman-filter","mpu6050","peripheral","stm32","stm32f103c8t6","stm32f401ccu6"],"created_at":"2026-03-15T03:00:23.563Z","updated_at":"2026-03-29T08:00:52.946Z","avatar_url":"https://github.com/leech001.png","language":"C","funding_links":[],"categories":["Sensor"],"sub_categories":[],"readme":"# STM32 HAL library for GY-521 (MPU6050) with Kalman filter\n\n## English note\nA simple C library (STM32 HAL) for working with the GY-521 module (MPU6050) https://www.aliexpress.com/af/gy%25252d521.html?trafficChannel=af\u0026d=y\u0026CatId=0\u0026SearchText=gy-521\u0026ltype=affiliate\u0026SortType= total_tranpro_desc \u0026 groupsort = 1 \u0026 page = 1\n\nStart and initialize the I2C bus using the STM32CubeMX.\n\n![I2C](https://github.com/leech001/MPU6050/blob/master/img/I2C_param.png)\n\nConfigure STM32CubeMX by setting \"General peripheral Initalizion as a pair of '.c / .h' file per peripheral\" in the project settings.\n\n\n\nCopy the library header and source file to the appropriate project directories (Inc, Src).\n\nIn the head file of your project (main.c), include the header file\n```\n/ * USER CODE BEGIN Includes * /\n#include \"mpu6050.h\"\n/ * USER CODE END Includes * /\n```\nadd structure to the section\n```\n/ * USER CODE BEGIN PV * /\nMPU6050_t MPU6050;\n/ * USER CODE END PV * /\n```\nadd int main (void) to the function section\n```\n/ * USER CODE BEGIN 2 * /\n\nwhile (MPU6050_Init(\u0026hi2c1) == 1);\n\n/ * USER CODE END 2 * /\n```\nfor initial initialization of the GY-521 (MPU6050).\n\nadd int main (void) to the function section\n```\n/ * USER CODE BEGIN WHILE * /\nwhile (1)\n{\n/ * USER CODE END WHILE * /\n\n/ * USER CODE BEGIN 3 * /\n  MPU6050_Read_All(\u0026hi2c1, \u0026MPU6050);\n  HAL_Delay (100);\n}\n/ * USER CODE END 3 * /\n```\nOn this project setup is ready.\nAfter starting the program, information from the GY-521 (MPU6050) will be available through the MPU6050 structure\n```\nMPU6050.KalmanAngleX\n```\nThe Kalman filter algorithm for calculating angles is taken from the project https://github.com/TKJElectronics/KalmanFilter\n\n## Russian note\nПростая библиотека на Си (STM32 HAL) для работы с модулем GY-521 (MPU6050) https://www.aliexpress.com/af/gy%25252d521.html?trafficChannel=af\u0026d=y\u0026CatId=0\u0026SearchText=gy-521\u0026ltype=affiliate\u0026SortType=total_tranpro_desc\u0026groupsort=1\u0026page=1\n\nЗапустите и инициализируйте шину I2C c помощью STM32CubeMX.\n\n![I2C](https://github.com/leech001/MPU6050/blob/master/img/I2C_param.png)\n\nСконфигурируйте STM32CubeMX установив \"General peripheral Initalizion as a pair of '.c/.h' file per peripheral\" в настройках проекта.\n\nСкопируйте заголовочный и исходный файл библиотеки в соотвесвтующие директории проекта (Inc, Src).\n\nВ головном файл вашего проекта (main.c) подключите заголовочный файл\n```\n/* USER CODE BEGIN Includes */\n#include \"mpu6050.h\"\n/* USER CODE END Includes */\n```\nв секцию добавьте структуру\n```\n/* USER CODE BEGIN PV */\nMPU6050_t MPU6050;\n/* USER CODE END PV */\n```\nдобавьте в секцию функции int main(void)\n```\n/* USER CODE BEGIN 2 */\n\nwhile (MPU6050_Init(\u0026hi2c1) == 1);\n\n/* USER CODE END 2 */\n```\nдля начальной инициализации GY-521 (MPU6050).\n\nдобавьте в секцию функции int main(void)\n```\n/* USER CODE BEGIN WHILE */\nwhile (1)\n{\n/* USER CODE END WHILE */\n\n/* USER CODE BEGIN 3 */\n  MPU6050_Read_All(\u0026hi2c1, \u0026MPU6050);\n  HAL_Delay(100);\n}\n/* USER CODE END 3 */\n```\nНа этом настройка проекта готова.\nПосле запуска программы информация от GY-521 (MPU6050) будет доступна через структуру MPU6050\n```\nMPU6050.KalmanAngleX\n```\nАлгоритм фильтра Калмана для расчета углов взят из проекта https://github.com/TKJElectronics/KalmanFilter\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleech001%2FMPU6050","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleech001%2FMPU6050","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleech001%2FMPU6050/lists"}