weixin_43983361 2022-05-31 17:48 采纳率: 0%
浏览 114

Arduino编译时MPU6050库会报错

添加头文件引用就会报错

代码:仅添加头文件
#include"MPU6050.h"

void setup() {
// put your setup code here, to run once:

}
void loop() {
// put your main code here, to run repeatedly:
}

报错结果:In file included from D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_9Axis_MotionApps41.cpp:36:0:
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_9Axis_MotionApps41.h:124:7: error: 'prog_uchar' does not name a type; did you mean 'getchar'?
const prog_uchar dmpMemory[MPU6050_DMP_CODE_SIZE] PROGMEM = {
^
getchar
In file included from D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.cpp:42:0:
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:46:57: error: expected class-name before '{' token
class MPU6050_6Axis_MotionApps612 : public MPU6050_Base {
^
In file included from D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.cpp:42:0:
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:81:29: error: 'VectorInt16' has not been declared
uint8_t dmpGetAccel(VectorInt16 v, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:81:17: error: 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetAccel(int*, const uint8_t*)' cannot be overloaded
uint8_t dmpGetAccel(VectorInt16 v, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:80:17: error: with 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetAccel(int16_t*, const uint8_t*)'
uint8_t dmpGetAccel(int16_t data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:84:34: error: 'Quaternion' has not been declared
uint8_t dmpGetQuaternion(Quaternion q, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:84:17: error: 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetQuaternion(int*, const uint8_t*)' cannot be overloaded
uint8_t dmpGetQuaternion(Quaternion q, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:83:17: error: with 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetQuaternion(int16_t*, const uint8_t*)'
uint8_t dmpGetQuaternion(int16_t data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:87:39: error: 'Quaternion' has not been declared
uint8_t dmpGet6AxisQuaternion(Quaternion q, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:87:17: error: 'uint8_t MPU6050_6Axis_MotionApps612::dmpGet6AxisQuaternion(int*, const uint8_t*)' cannot be overloaded
uint8_t dmpGet6AxisQuaternion(Quaternion q, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:86:17: error: with 'uint8_t MPU6050_6Axis_MotionApps612::dmpGet6AxisQuaternion(int16_t*, const uint8_t*)'
uint8_t dmpGet6AxisQuaternion(int16_t data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:90:42: error: 'Quaternion' has not been declared
uint8_t dmpGetRelativeQuaternion(Quaternion data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:90:17: error: 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetRelativeQuaternion(int*, const uint8_t*)' cannot be overloaded
uint8_t dmpGetRelativeQuaternion(Quaternion data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:89:17: error: with 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetRelativeQuaternion(int16_t*, const uint8_t*)'
uint8_t dmpGetRelativeQuaternion(int16_t data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:93:28: error: 'VectorInt16' has not been declared
uint8_t dmpGetGyro(VectorInt16 v, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:93:17: error: 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetGyro(int*, const uint8_t*)' cannot be overloaded
uint8_t dmpGetGyro(VectorInt16 v, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:92:17: error: with 'uint8_t MPU6050_6Axis_MotionApps612::dmpGetGyro(int16_t*, const uint8_t*)'
uint8_t dmpGetGyro(int16_t data, const uint8_t packet=0);
^
D:\Program Files (x86)\Arduino\libraries\MPU6050\MPU6050_6Axis_MotionApps612.h:97:35: error: 'VectorInt16' has not been declared
uint8_t dmpGetLinearAccel(VectorInt16 v, const uint8_t packet=0);
^

        dmpGetFIFOPacketSize

exit status 1
为开发板 Arduino Uno 编译时出错。

试着更换过MPU6050库,但是没有效果

知道原因并解决问题

  • 写回答

1条回答 默认 最新

  • 「已注销」 2022-05-31 18:21
    关注

    这么多报错,你把报错复制到记事本发给我

    评论

报告相同问题?

问题事件

  • 创建了问题 5月31日

悬赏问题

  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error