> For the complete documentation index, see [llms.txt](https://docs.petoi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petoi.com/thai/biboard/demo-applications/6.gyro-imu-mpu6050.md).

# 6.Gyro IMU（MPU6050）

MPU6050 เป็นไจโรสโคป 6 แกนที่ใช้กันแพร่หลายมากที่สุด ซึ่งไม่เพียงวัดความเร็วเชิงมุม 3 แกนและการเร่งความเร็ว 3 แกนได้แม่นยำมากขึ้น แต่ยังใช้ตัวประมวลผลการเคลื่อนไหวแบบดิจิตอล (DMP) ในตัวสำหรับการคำนวณฟิวชั่นทัศนคติตามฮาร์ดแวร์ มือใหม่จึงใช้งานได้สะดวกมาก ด้วยเหตุนี้ เราจึงใช้ไจโรสโคป MPU6050

มีการสาธิต MPU6050 มากมายบน Arduino UNO ที่มีชื่อเสียงที่สุดคือไลบรารี I2Cdev และ MPU6050DMP ของ jrowberg:

{% embed url="<https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050>" %}

ขออภัย ไลบรารีนี้ไม่สามารถเรียกใช้โดยตรงบน BiBoard ที่ใช้ ESP32 เราพบไลบรารีที่มีบน Github ซึ่งใช้งานง่าย ไลบรารีนี้เพิ่มคำจำกัดความของ PGMSpace สำหรับซีรีส์ ARM และ ESP เพิ่มฟังก์ชันการปรับเทียบ และลบฟังก์ชันการประมวลผลเกิน FIFO (เพื่อนๆ ที่สนใจสามารถใช้ Beyond Compare สำหรับการเปรียบเทียบโค้ดได้) ไลบรารีประกอบด้วย I2Cdev และ MPU6050 ที่อยู่และแพ็คเกจที่บีบอัดมีดังนี้:

{% embed url="<https://github.com/ElectronicCats/mpu6050/tree/master/src>" %}

{% file src="/files/-McCm4zwUWO7wB\_3RRFN" %}
mpu6050-master.zip
{% endfile %}

หลังจากการดาวน์โหลดเสร็จสิ้น ให้สร้างโฟลเดอร์ MPU6050 ภายใต้ Documents/Arduino/library และคัดลอกไฟล์ไลบรารีในแพ็คเกจที่บีบอัดลงไป ไลบรารีของ MPU6050 ที่แก้ไขนี้ยังเข้ากันได้กับ ARM และ AVR ดังนั้นหากคุณมีไลบรารี I2Cdev และ MPU6050 ดั้งเดิมในคอมพิวเตอร์ของคุณ คุณสามารถลบออกได้

เราสามารถใช้การตัวอย่าง MPU6050\_DMP6 อย่างเป็นทางการ


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.petoi.com/thai/biboard/demo-applications/6.gyro-imu-mpu6050.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
