极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: pww999

arduino摇控平衡车m2560+mpu6050+24l01 (已上传代码包)

  [复制链接]
发表于 2013-5-31 07:52:36 | 显示全部楼层
谢谢,我直接放在上面的图中下方的文件夹中就能编译了,非常感谢 PWW999!
回复 支持 反对

使用道具 举报

发表于 2013-6-14 03:49:05 | 显示全部楼层
本帖最后由 ch00148070 于 2013-6-14 03:57 编辑

请问这个偏移量#define Gry_offset -20     // 静态偏移量   根据下面哪个参数来调?-20是怎么算出来的?下面这些参数小车垂直静止时都要归0吗?
  Serial.print(ax/10); Serial.print("\t");
    Serial.print(ay/10); Serial.print("\t");
    Serial.print(az/10); Serial.print("\t");
    Serial.print(gx/10); Serial.print("\t");
    Serial.print(gy/10); Serial.print("\t");
    Serial.print(gz/10);Serial.print("\t");
    Serial.print(f_angle); Serial.print("\t");   
    Serial.print(omega); Serial.print("\t");  //omega=  Gyr_Gain * (gx +  Gry_offset);调这个Gry_offset的值使它归0吗?
    Serial.print(angleA); Serial.print("\t");    //angleA= atan2(ay , az) * 180 / pi+0.5(垂直静止时调这个0.5使它归0吗);
      Serial.print(Output); Serial.print("\t");

我的小车现在想站起来,抖几下就往前开了。好像重心偏前,不知道怎么调?
回复 支持 反对

使用道具 举报

发表于 2013-6-14 07:19:33 | 显示全部楼层
支持啊{:soso_e179:}
回复 支持 反对

使用道具 举报

发表于 2013-6-18 11:17:59 | 显示全部楼层
非常好的东西。。。
回复 支持 反对

使用道具 举报

发表于 2013-6-20 13:45:56 | 显示全部楼层
大神,我这里6050老是编译错误,是为什么?
我替换了几次库文件了。。还是这样

MPU6050\MPU6050.cpp.o: In function `MPU6050':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:42: multiple definition of `MPU6050::MPU6050()'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:42: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:42: multiple definition of `MPU6050::MPU6050()'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:42: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:52: multiple definition of `MPU6050::MPU6050(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:52: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:52: multiple definition of `MPU6050::MPU6050(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:52: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setDMPConfig2(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:3140: multiple definition of `MPU6050::setDMPConfig2(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:3140: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setDMPConfig1(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:3130: multiple definition of `MPU6050::setDMPConfig1(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:3130: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::writeMemoryByte(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2932: multiple definition of `MPU6050::writeMemoryByte(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2932: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setMemoryStartAddress(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2922: multiple definition of `MPU6050::setMemoryStartAddress(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2922: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setMemoryBank(unsigned char, bool, bool)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2913: multiple definition of `MPU6050::setMemoryBank(unsigned char, bool, bool)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2913: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setZFineGain(signed char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2779: multiple definition of `MPU6050::setZFineGain(signed char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2779: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setYFineGain(signed char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2769: multiple definition of `MPU6050::setYFineGain(signed char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2769: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setXFineGain(signed char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2759: multiple definition of `MPU6050::setXFineGain(signed char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2759: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setFIFOByte(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2684: multiple definition of `MPU6050::setFIFOByte(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2684: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlaveOutputByte(unsigned char, unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:2067: multiple definition of `MPU6050::setSlaveOutputByte(unsigned char, unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:2067: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setIntEnabled(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:1499: multiple definition of `MPU6050::setIntEnabled(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:1499: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlave4OutputByte(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:1112: multiple definition of `MPU6050::setSlave4OutputByte(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:1112: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlave4Register(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:1103: multiple definition of `MPU6050::setSlave4Register(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:1103: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlave4Address(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:1084: multiple definition of `MPU6050::setSlave4Address(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:1084: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlaveRegister(unsigned char, unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:938: multiple definition of `MPU6050::setSlaveRegister(unsigned char, unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:938: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setSlaveAddress(unsigned char, unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:912: multiple definition of `MPU6050::setSlaveAddress(unsigned char, unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:912: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setZeroMotionDetectionDuration(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:573: multiple definition of `MPU6050::setZeroMotionDetectionDuration(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:573: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setZeroMotionDetectionThreshold(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:542: multiple definition of `MPU6050::setZeroMotionDetectionThreshold(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:542: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setMotionDetectionDuration(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:502: multiple definition of `MPU6050::setMotionDetectionDuration(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:502: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setMotionDetectionThreshold(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:472: multiple definition of `MPU6050::setMotionDetectionThreshold(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:472: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setFreefallDetectionDuration(unsigned char)':
G:\arduino\arduino-1.0.1\libraries\MPU6050/MPU6050.cpp:438: multiple definition of `MPU6050::setFreefallDetectionDuration(unsigned char)'
MPU6050.cpp.o:C:\Users\shadow\AppData\Local\Temp\build3457055428808906085.tmp/MPU6050.cpp:438: first defined here
MPU6050\MPU6050.cpp.o: In function `MPU6050::setFreefallDetectionThreshold(unsigned char)':
回复 支持 反对

使用道具 举报

发表于 2013-7-21 20:11:59 | 显示全部楼层
ranqingfa 发表于 2012-11-16 00:25
车车相当酷啊,我用的香蕉电机做的真是难啊http://v.youku.com/v_show/id_XNDM5NDcwNjM2.html,劳神看一下啊 ...

你好  我看了下你的平衡小车视频   做的很COOL   有个问题问下  你的码盘用来做什么呀    顺便无耻下   能把你的代码给我一份不  我也是用的香蕉电机   站一会儿(几秒)就倒   烦啊。。。。谢谢咯
回复 支持 反对

使用道具 举报

发表于 2013-7-22 09:25:29 | 显示全部楼层
tanbocandy 发表于 2013-7-21 20:11
你好  我看了下你的平衡小车视频   做的很COOL   有个问题问下  你的码盘用来做什么呀    顺便无耻下   能 ...

本坛我有共享程序,你找找,小米遥控平衡车
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-7-22 10:14:10 | 显示全部楼层
tanbocandy 发表于 2013-7-21 20:11
你好  我看了下你的平衡小车视频   做的很COOL   有个问题问下  你的码盘用来做什么呀    顺便无耻下   能 ...

没有装码盘,
回复 支持 反对

使用道具 举报

发表于 2013-7-24 20:17:45 | 显示全部楼层
ranqingfa 发表于 2013-7-22 09:25
本坛我有共享程序,你找找,小米遥控平衡车

找到了 谢谢
回复 支持 反对

使用道具 举报

发表于 2013-9-28 17:51:32 | 显示全部楼层
pww999 发表于 2012-9-22 23:59
可以这样试试,或者你可以先用可调电阻测试一下L298正反转运作...,最组合代码
IN1=4;//接D4
IN2 =7;

大神  真心不知道你EN 1 2  怎么接线
l298不就是4个输入吗?怎么整出来6 个呢
我不会了。求大神指点啊 !!!

还有你的6050是怎么放置的啊?
回复 支持 反对

使用道具 举报

发表于 2013-10-30 11:32:42 | 显示全部楼层
狠好,不错( ⊙ o ⊙ )啊!
回复 支持 反对

使用道具 举报

发表于 2013-11-17 23:13:32 | 显示全部楼层
编译老是出错,求解

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

发表于 2013-11-17 23:15:02 | 显示全部楼层
冬至_半边天、 发表于 2013-9-28 17:51
大神  真心不知道你EN 1 2  怎么接线
l298不就是4个输入吗?怎么整出来6 个呢
我不会了。求大神指点啊 ...

这两个是接pwm脚,注意看看你298N上是不是有2个跳线帽,拔掉后就可以接了
回复 支持 反对

使用道具 举报

发表于 2013-12-3 18:51:44 | 显示全部楼层
加油  啊  不会编程啊
回复 支持 反对

使用道具 举报

发表于 2013-12-8 23:09:29 | 显示全部楼层
用了你的程序  发现我的小车只有一个轮子转动 且只有一个方向 求指教
回复 支持 反对

使用道具 举报

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

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

Archiver|联系我们|极客工坊

GMT+8, 2024-4-27 07:59 , Processed in 0.046484 second(s), 27 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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