-
大小: 50KB文件类型: .rar金币: 2下载: 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
相关资源
- mpu6050+hmc5883L.rar
- ADNS-3080光流传感器测试程序Arduino
- EESkill NRF24L01 无线模块用户手册
- Arduino nano 工程文件
- Arduino教程 Lesson 之--自制风扇
- 陀螺仪MPU6050驱动
- 基于Arduino的智能环境监控系统设计
- 基于Arduino和Machtalk的温棚环境监测系
- arduino pca9685多舵机同时控制案例
- DNF偏移查找工具源码DNF-offset-lookup-t
- arduino技术内幕
- Arduino电子设计实战指南.零基础篇_超
- 物联网智能家居平台DIY:ARDUINO 物联网
- 实验1.zip arduino跑马灯led灯实验,串口
- opencat所有资料.zip
- STM32F1单片机MPU6050加速度计陀螺仪驱动
- arduino主机,stm8从机。I2C测试 。每次
- DS18B20_Serial_println.ino
- ps2手柄arduino库文件
- 基于手机蓝牙的arduino遥控小车
- arduino中的can库函数
- 两轮平衡车源程序,方能仪器,自平
- 密码+指纹锁资料包.rar
- 基于stm32的六轴传感器驱动工程文件
- 贝壳物联arduino esp8266 demo版本
- HMC5883L罗盘指南针模块库文件及中英文
- arduino 小贱钟源码及教程
- MPU6050数据发送到匿名上位机2.4版本的
- Atom-TMC2208Pilot在Arduino上运行的应用程
- 写字机制作方案
评论
共有 条评论