-
大小: 50KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-06-07
- 语言: 其他
- 标签: arduino MPU6050 offset calibration
资源简介
arduino程序,自动计算MPU6050的offset,显示如下:
Sensor readings with offsets: 0 0 16391 -2 0 0
Your offsets: -1495 -454 2369 58 -36 31
Data is printed as: acelX acelY acelZ giroX giroY giroZ
Check that your sensor readings are close to 0 0 16384 0 0 0
If calibration was succesful write down your offsets so you can set them in your projects using something similar to mpu.setXAccelOffset(youroffset)
简单快速,把该偏移带入mpu6050替换下面的值:
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXAccelOffset(-1495);
mpu.setYAccelOffset(-454);
mpu.setZAccelOffset(2369);
mpu.setXGyroOffset(58);
mpu.setYGyroOffset(-36);
mpu.setZGyroOffset(31); // 1688 factory default for my test chip 。
代码片段和文件信息
// I2Cdev library collection - MPU6050 I2C device class
// based on InvenSense MPU-6050 register map document rev. 2.0 5/19/2011 (RM-MPU-6000A-00)
// 8/24/2011 by Jeff Rowberg
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// ... - ongoing debug release
// NOTE: THIS IS ONLY A PARIAL RELEASE. THIS DEVICE CLASS IS CURRENTLY UNDERGOING ACTIVE
// DEVELOPMENT AND IS STILL MISSING SOME IMPORTANT FEATURES. PLEASE KEEP THIS IN MIND IF
// YOU DECIDE TO USE THIS PARTICULAR CODE FOR ANYTHING.
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================
*/
#include “MPU6050.h“
/** Default constructor uses default I2C address.
* @see MPU6050_DEFAULT_ADDRESS
*/
MPU6050::MPU6050() {
devAddr = MPU6050_DEFAULT_ADDRESS;
}
/** Specific address constructor.
* @param address I2C address
* @see MPU6050_DEFAULT_ADDRESS
* @see MPU6050_ADDRESS_AD0_LOW
* @see MPU6050_ADDRESS_AD0_HIGH
*/
MPU6050::MPU6050(uint8_t address) {
devAddr = address;
}
/** Power on and prepare for general usage.
* This will activate the device and take it out of sleep mode (which must be done
* after start-up). This function also sets both the accelerometer and the gyroscope
* to their most sensitive settings namely +/- 2g and +/- 250 degrees/sec and sets
* the clock source to use the X Gyro for reference which is slightly better than
* the default internal clock source.
*/
void MPU6050::initialize() {
setClockSource(MPU6050_CLOCK_PLL_XGYRO);
setFullScaleGyroRange(MPU6050_GYRO_FS_250);
setFullScaleAccelRange(MPU6050_ACCEL_FS_2);
setSleepEnabled(false); // thanks to Jack Elston for pointing this one out!
}
/** Verify the I2C connection.
* Make sure the device is connected and responds as expected.
* @return True if connection is valid fa
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6413 2013-10-24 20:52 MPU6050_calibration\helper_3dmath.h
文件 126508 2013-10-24 20:52 MPU6050_calibration\MPU6050.cpp
文件 42528 2013-10-24 20:52 MPU6050_calibration\MPU6050.h
文件 40745 2014-04-06 02:27 MPU6050_calibration\MPU6050_6Axis_MotionApps20.h
文件 48256 2013-10-24 20:52 MPU6050_calibration\MPU6050_9Axis_MotionApps41.h
文件 7820 2018-04-13 10:22 MPU6050_calibration\MPU6050_Calibration.ino
目录 0 2018-04-13 13:25 MPU6050_calibration
----------- --------- ---------- ----- ----
272270 7
相关资源
- XLoader hex文件
- arduino-uno-r3 电路图
- 颜色传感器ARDUINO代码
- PS2手柄 - arduino版本例程
- RFID.h RC522
- MPU6050 DMP官方手册中文翻译版
- 适合初学者借鉴的arduino智能小车代码
- arduino uno 控制二自由度舵机云台
- 51单片机 MPU6050读取并通过串口输出
- 移动onenet 基于arduino IDE 的mqtt连接
- arduino平台下CC2520 zigbee模块的驱动
- ArduinoLED矩阵代码
- Arduino 平衡小车
- LiquidCrystal_I2C驱动Arduino IDE 1.0以上版本
- arduino1602屏幕滚动显示
- PMS5003T Arduino Uno
- Arduino_PS2X库文件
- arduino与Unity串口通讯.docx
- arduino new ping
- 基于51单片机的计步手环
- 关于12864显示屏与arduino的连接图
- 基于arduino驱动步进电机旋转魔方的全
- GY530-VL53L0X ARDUINO激光测距代码
- MsTimer2.zip
- Arduino 亚博智能平衡小车源码
- Arduino_Uno-原理图
- flexitimer2库
- Arduino 超声波库函数
- arduino 读取温湿度dht11
- arduino电子时钟
评论
共有 条评论