{"id":21223911,"url":"https://github.com/niklauslee/mpu6050","last_synced_at":"2025-03-15T01:33:56.319Z","repository":{"id":77037140,"uuid":"460275701","full_name":"niklauslee/mpu6050","owner":"niklauslee","description":"Kaluma library for MPU6050 6-axis motion sensor","archived":false,"fork":false,"pushed_at":"2022-02-17T04:57:31.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T17:30:41.285Z","etag":null,"topics":["accelerometer","gyroscope","kaluma","motion-sensor","mpu6050"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/niklauslee.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-02-17T04:03:53.000Z","updated_at":"2024-05-02T18:30:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"612f3525-5c3e-410b-8203-288d78dc513b","html_url":"https://github.com/niklauslee/mpu6050","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fmpu6050","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fmpu6050/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fmpu6050/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fmpu6050/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklauslee","download_url":"https://codeload.github.com/niklauslee/mpu6050/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243671781,"owners_count":20328694,"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","gyroscope","kaluma","motion-sensor","mpu6050"],"created_at":"2024-11-20T22:54:01.003Z","updated_at":"2025-03-15T01:33:56.278Z","avatar_url":"https://github.com/niklauslee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPU6050\n\nKaluma library for MPU6050 6-axis motion sensor (3-axis accelerometer and 3-axis gyroscope).\n\n# Wiring\n\nHere is a wiring example for `I2C0`.\n\n| Raspberry Pi Pico | MPU6050 |\n| ----------------- | ------- |\n| 3V3               | VCC     |\n| GND               | GND     |\n| GP4 (I2C0 SDA)    | SDA     |\n| GP5 (I2C0 SCL)    | SCL     |\n\n![wiring](https://github.com/niklauslee/mpu6050/blob/main/images/wiring.jpg?raw=true)\n\n# Install\n\n```sh\nnpm install https://github.com/niklauslee/mpu6050\n```\n\n# Usage\n\nHere is an example code for reading raw data from MPU6050.\n\n```javascript\nconst {I2C} = require('i2c');\nconst i2c0 = new I2C(0);\n\nconst {MPU6050} = require('mpu6050');\nconst mpu = new MPU6050();\nmpu.setup(i2c0);\n\nsetInterval(() =\u003e {\n  let v = mpu.read();\n  console.log(`ax=${v[0]},ay=${v[1]},az=${v[2]},gx=${v[4]},gy=${v[5]},gz=${v[6]},tmp=${v[3]}`);\n}, 100);\n```\n\n# API\n\n## Class: MPU6050\n\nA class for MPU6050.\n\n### new MPU6050()\n\nCreate an instance of MPU6050 driver.\n\n### mpu6050.setup(i2c)\n\n- **`i2c`** `\u003cI2C\u003e` An instance of `I2C` to communicate.\n\nSetup MPU6050 for a given I2C bus.\n\n### mpu6050.read()\n\n- **Returns**: `\u003cInt16Array[7]\u003e` An array of 16-bit signed integer value. The elements of returned array are as below:\n  - `[0]` : X-axis of accelerometer (16-bit signed int)\n  - `[1]` : Y-axis of accelerometer (16-bit signed int)\n  - `[2]` : Z-axis of accelerometer (16-bit signed int)\n  - `[3]` : Temperature (16-bit signed int)\n  - `[4]` : X-axis of gyroscope (16-bit signed int)\n  - `[5]` : Y-axis of gyroscope (16-bit signed int)\n  - `[6]` : Z-axis of gyroscope (16-bit signed int)\n\n\u003e The returned values are raw data, so you may need to calibrate the raw data or apply some filters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fmpu6050","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklauslee%2Fmpu6050","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fmpu6050/lists"}