{"id":19495607,"url":"https://github.com/tockn/mpu6050_tockn","last_synced_at":"2025-04-09T14:15:00.100Z","repository":{"id":58846240,"uuid":"124728902","full_name":"tockn/MPU6050_tockn","owner":"tockn","description":"Arduino library for easy communication with MPU6050","archived":false,"fork":false,"pushed_at":"2020-09-30T15:51:49.000Z","size":36,"stargazers_count":230,"open_issues_count":34,"forks_count":92,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-02T08:39:40.136Z","etag":null,"topics":["accelerometer","arduino","arduino-library","gyroscope","mpu6050"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tockn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-11T06:13:31.000Z","updated_at":"2025-03-12T12:48:37.000Z","dependencies_parsed_at":"2022-09-12T06:40:18.633Z","dependency_job_id":null,"html_url":"https://github.com/tockn/MPU6050_tockn","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tockn%2FMPU6050_tockn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tockn%2FMPU6050_tockn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tockn%2FMPU6050_tockn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tockn%2FMPU6050_tockn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tockn","download_url":"https://codeload.github.com/tockn/MPU6050_tockn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054193,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["accelerometer","arduino","arduino-library","gyroscope","mpu6050"],"created_at":"2024-11-10T21:38:25.272Z","updated_at":"2025-04-09T14:15:00.080Z","avatar_url":"https://github.com/tockn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPU6050_tockn\nArduino library for easy communicating with the MPU6050\n## Usage\nYou can see [example sketch.](https://github.com/Tockn/MPU6050_tockn/tree/master/examples)  \n  \nIf you want to get data of MPU6050, you must execute `update()` method before get method.  \n`update()` will get all data of MPU6050, and calculating angle by accelerometer, gyroscope and complementary filter.  \n\n### Complementary filter\n`update()` method calculate angle by accelerometer and gyroscope using complementary filter.  \nThose two coefficients determined by constructor.  \nDefault coefficient of accelerometer is 0.02, gyroscope is 0.98.  \n`filtered_angle = (0.02 * accel) + (0.98 * gyro)`  \n#### example\nIf you want to set 0.1 to accelerometer coefficient and 0.9 to gyroscope coefficient, your code is  \n```MPU6050 mpu6050(Wire, 0.1, 0.9);```  \n\n\n### Auto calibration\nIf you use `calcGyroOffsets()` in `setup()`, it will calculate calibration of the gyroscope, and the value of the gyroscope will calibrated.  \n⚠DO NOT MOVE MPU6050 during calculating.⚠  \n```\n#include \u003cMPU6050_tockn\u003e\n#include \u003cWire.h\u003e\n\nMPU6050 mpu6050(Wire);\n\nvoid setup(){\n  Wire.begin();\n  mpu6050.begin();\n  mpu6050.calcGyroOffsets();\n}\n\n```\n\nIf you use `calcGyroOffsets(true)` in `setup()`, you can see state of calculating calibration in serial monitor.  \n```\n#include \u003cMPU6050_tockn\u003e\n#include \u003cWire.h\u003e\n\nMPU6050 mpu6050(Wire);\n\nvoid setup(){\n  Serial.begin(9600);\n  Wire.begin();\n  mpu6050.begin();\n  mpu6050.calcGyroOffsets(true);\n}\n```\nSerial monitor:\n```\nCalculate gyro offsets\nDO NOT MOVE MPU6050.....\nDone!\nX : 1.45\nY : 1.23\nZ : -1.32\nProgram will start after 3 seconds\n```  \n  \nIf you know offsets of gyroscope, you can set them by `setGyroOffsets()`, and you don't have to execute `calcGyroOffsets()`, so you can launch program quickly.\n#### example\n```\n#include \u003cMPU6050_tockn\u003e\n#include \u003cWire.h\u003e\n\nMPU6050 mpu6050(Wire);\n\nvoid setup(){\n  Serial.begin(9600);\n  Wire.begin();\n  mpu6050.begin();\n  mpu6050.setGyroOffsets(1.45, 1.23, -1.32);\n}\n```\n## Licence\nMIT\n## Author\n\n[tockn](https://github.com/tockn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftockn%2Fmpu6050_tockn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftockn%2Fmpu6050_tockn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftockn%2Fmpu6050_tockn/lists"}