极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: Randy

arduino学习笔记37 - Arduino Uno + MPU6050首例整合性6轴演示实验

  [复制链接]
发表于 2015-3-29 22:06:13 | 显示全部楼层
太强大了!表示只看懂一点点!
回复 支持 反对

使用道具 举报

发表于 2015-4-7 15:44:13 | 显示全部楼层
我运行上面第二个程序的时候接上陀螺仪都没有输出,把陀螺仪断开就显示所有结果都是0,救助啊是不是我的陀螺仪模块坏了?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2015-4-8 22:41:08 | 显示全部楼层
Arduino:1.6.3 (Windows 7), 板:"Arduino Uno"

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::I2Cdev()'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::I2Cdev()'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeBytes(unsigned char, unsigned char, unsigned char, unsigned char*)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeByte(unsigned char, unsigned char, unsigned char)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeWords(unsigned char, unsigned char, unsigned char, unsigned int*)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeWord(unsigned char, unsigned char, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readByte(unsigned char, unsigned char, unsigned char*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readBit(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeBit(unsigned char, unsigned char, unsigned char, unsigned char)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readTimeout'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readWords(unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readWord(unsigned char, unsigned char, unsigned int*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readBitW(unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::readBitsW(unsigned char, unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeBitW(unsigned char, unsigned char, unsigned char, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

MPU6050\I2Cdev.cpp.o: In function `I2Cdev::I2Cdev()':

F:\WORK\pri\arduino-1.6.3\libraries\MPU6050/I2Cdev.cpp:53: multiple definition of `I2Cdev::writeBitsW(unsigned char, unsigned char, unsigned char, unsigned char, unsigned int)'

I2Cdev\I2Cdev.cpp.o:F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev/I2Cdev.cpp:53: first defined here

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "I2Cdev.h"

Used: F:\WORK\pri\arduino-1.6.3\libraries\I2Cdev

Not used: F:\WORK\pri\arduino-1.6.3\libraries\MPU6050

编译有误。

  报告将会包含更多的信息
  "在编译时,输出详细信息"
  在 文件>首选项 中启用
回复 支持 反对

使用道具 举报

发表于 2015-4-8 23:08:54 | 显示全部楼层
本帖最后由 thinkon 于 2015-4-8 23:10 编辑


出现乱码  怎么回事啊
A4→SDA
A5→SCL
没错啊

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2015-4-9 22:18:06 | 显示全部楼层
孤独舰 发表于 2014-7-12 10:01
请问,16384和131怎么得到的?

我也纳闷这个事情。
回复 支持 反对

使用道具 举报

发表于 2015-4-9 22:19:16 | 显示全部楼层
thinkon 发表于 2015-4-8 23:08
出现乱码  怎么回事啊
A4→SDA
A5→SCL

你截图窗口右下角的波特率要和程序对应。
回复 支持 反对

使用道具 举报

发表于 2015-4-9 22:49:06 | 显示全部楼层
出来的角度都是零点几的,如果我想用度了表示:
    Serial.print(ax/16384.0*90.0); Serial.print("\t");
    Serial.print(ay/16384.0*90.0); Serial.print("\t");
    Serial.print(az/16384.0*90.0); Serial.print("\t");
这样写对不对?
回复 支持 反对

使用道具 举报

发表于 2015-4-19 12:52:51 | 显示全部楼层
非常感谢楼主,不用花费过多的时间去找库函数了
回复 支持 反对

使用道具 举报

发表于 2015-4-29 13:03:31 | 显示全部楼层
楼主,问一下  int16_t 这个是什么意思
回复 支持 反对

使用道具 举报

发表于 2015-5-9 00:01:59 | 显示全部楼层
darkorigin 发表于 2012-5-25 15:46
气压计主要是用来辅助计算所在海拔的(气压和海拔有对应关系),但是物理学基本常识告诉我们,这些都是相 ...

可以稳定飞行高度
回复 支持 反对

使用道具 举报

发表于 2015-5-10 22:15:01 | 显示全部楼层
butOn 发表于 2015-5-9 00:01
可以稳定飞行高度

严格的说 是在大多数情况下 通过气压计算海拔从而辅助稳定高度。

气压在同一个地区同一个海拔条件下也会发生变化(比如受到天气影响而波动) 只是在大幅度变天的情况下 多数的业余无人机都会停止飞行(军用的就不在此列了)所以基本靠得住。

同时用来辅助确定飞行高程的还有积分计算的多轴姿态传感器数据 GPS数据,超声波数据
当然 还有军用的雷达波数据或者其他数据链的值。
回复 支持 反对

使用道具 举报

发表于 2015-5-21 16:07:40 | 显示全部楼层
本帖最后由 wo2581511 于 2015-5-21 16:12 编辑
Randy 发表于 2012-6-19 09:02
按照步骤来,一般没啥问题的,有问题欢迎贴出来一起解决!


core.a(main.cpp.o): In function `main':
/aaaa/arduino-1.6.0+Intel/hardware/intel/i586-uclibc/cores/arduino/main.cpp:56: undefined reference to `timeInit'
I2Cdev/I2Cdev.cpp.o: In function `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned short)':
/aaaa/arduino-1.6.0+Intel/libraries/I2Cdev/I2Cdev.cpp:193: undefined reference to `millis'
/aaaa/arduino-1.6.0+Intel/libraries/I2Cdev/I2Cdev.cpp:194: undefined reference to `millis'
/aaaa/arduino-1.6.0+Intel/libraries/I2Cdev/I2Cdev.cpp:205: undefined reference to `millis'
collect2: error: ld returned 1 exit status
Error compiling.
我的报这个错,为什么呢?求指教!
回复 支持 反对

使用道具 举报

发表于 2015-6-7 12:19:38 | 显示全部楼层

如果要用到arduino mirco上面   没有A4 和A5口

应该在哪里改定义呢
回复 支持 反对

使用道具 举报

发表于 2015-6-16 22:15:13 | 显示全部楼层
我的没有Wire.h,怎么回事
回复 支持 反对

使用道具 举报

发表于 2015-7-8 09:55:45 | 显示全部楼层
hotflog 发表于 2012-6-15 18:50
**** 作者被禁止或删除 内容自动屏蔽 ****

这个DMP程序为什么编译不通过呀
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-27 20:46 , Processed in 0.046789 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表