{"id":13802520,"url":"https://github.com/tuupola/micropython-mpu6886","last_synced_at":"2025-04-10T08:58:49.886Z","repository":{"id":40656531,"uuid":"249707097","full_name":"tuupola/micropython-mpu6886","owner":"tuupola","description":"MicroPython I2C driver for MPU6886 6-axis motion tracking device","archived":false,"fork":false,"pushed_at":"2020-03-27T09:01:07.000Z","size":8,"stargazers_count":22,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T08:12:10.445Z","etag":null,"topics":["micropython","mpu6886"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuupola.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-24T12:50:59.000Z","updated_at":"2025-03-07T01:41:09.000Z","dependencies_parsed_at":"2022-09-06T02:40:27.651Z","dependency_job_id":null,"html_url":"https://github.com/tuupola/micropython-mpu6886","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-mpu6886","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-mpu6886/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-mpu6886/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuupola%2Fmicropython-mpu6886/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuupola","download_url":"https://codeload.github.com/tuupola/micropython-mpu6886/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248091016,"owners_count":21046190,"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":["micropython","mpu6886"],"created_at":"2024-08-04T00:01:46.453Z","updated_at":"2025-04-10T08:58:49.861Z","avatar_url":"https://github.com/tuupola.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Sensors"],"readme":"# [WIP] MicroPython MPU-6886 I2C driver\n\nThe MPU-6886 is a 6-axis motion tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer.\n\n## Usage\n\nSimple test with never ending loop.\n\n```python\nimport utime\nfrom machine import I2C, Pin\nfrom mpu6886 import MPU6886\n\ni2c = I2C(scl=Pin(22), sda=Pin(21))\nsensor = MPU6886(i2c)\n\nprint(\"MPU6886 id: \" + hex(sensor.whoami))\n\nwhile True:\n    print(sensor.acceleration)\n    print(sensor.gyro)\n    print(sensor.temperature)\n\n    utime.sleep_ms(1000)\n```\n\nBy default the library returns 3-tuple of X, Y, Z axis values for acceleration and gyroscope. Default units are `m/s^2`, `rad/s` and `°C`. It is possible to also get acceleration values in `g` and gyro values `deg/s`. See the example below.\n\n```python\nimport utime\nfrom machine import I2C, Pin\nfrom mpu6886 import MPU6886, SF_G, SF_DEG_S\n\ni2c = I2C(scl=Pin(22), sda=Pin(21))\nsensor2 = MPU6886(i2c, accel_sf=SF_G, gyro_sf=SF_DEG_S)\n\nprint(\"MPU6886 id: \" + hex(sensor.whoami))\n\nwhile True:\n    print(sensor.acceleration)\n    print(sensor.gyro)\n    print(sensor.temperature)\n\n    utime.sleep_ms(1000)\n```\n\nMore realistic example usage with timer. If you get `OSError: 26` or `i2c driver install error` after soft reboot do a hard reboot.\n\n```python\nimport micropython\nfrom machine import I2C, Pin, Timer\nfrom mpu6886 import MPU6886\n\nmicropython.alloc_emergency_exception_buf(100)\n\ni2c = I2C(scl=Pin(22), sda=Pin(21))\nsensor = MPU6886(i2c)\n\ndef read_sensor(timer):\n    print(sensor.acceleration)\n    print(sensor.gyro)\n    print(sensor.temperature)\n\nprint(\"MPU6886 id: \" + hex(sensor.whoami))\n\ntimer_0 = Timer(0)\ntimer_0.init(period=1000, mode=Timer.PERIODIC, callback=read_sensor)\n```\n\n## Gyro Calibration\n\nTODO\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.txt) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fmicropython-mpu6886","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuupola%2Fmicropython-mpu6886","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuupola%2Fmicropython-mpu6886/lists"}