edwin 发表于 2013-5-31 07:52:36

谢谢,我直接放在上面的图中下方的文件夹中就能编译了,非常感谢 PWW999!

ch00148070 发表于 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");

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

chzhewl 发表于 2013-6-14 07:19:33

支持啊{:soso_e179:}

robotStudio 发表于 2013-6-18 11:17:59

非常好的东西。。。

shaodw 发表于 2013-6-20 13:45:56

大神,我这里6050老是编译错误,是为什么?
我替换了几次库文件了。。还是这样:Q

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)':

tanbocandy 发表于 2013-7-21 20:11:59

ranqingfa 发表于 2012-11-16 00:25 static/image/common/back.gif
车车相当酷啊,我用的香蕉电机做的真是难啊http://v.youku.com/v_show/id_XNDM5NDcwNjM2.html,劳神看一下啊 ...

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

ranqingfa 发表于 2013-7-22 09:25:29

tanbocandy 发表于 2013-7-21 20:11 static/image/common/back.gif
你好我看了下你的平衡小车视频   做的很COOL   有个问题问下你的码盘用来做什么呀    顺便无耻下   能 ...

本坛我有共享程序,你找找,小米遥控平衡车

pww999 发表于 2013-7-22 10:14:10

tanbocandy 发表于 2013-7-21 20:11 static/image/common/back.gif
你好我看了下你的平衡小车视频   做的很COOL   有个问题问下你的码盘用来做什么呀    顺便无耻下   能 ...

没有装码盘,

tanbocandy 发表于 2013-7-24 20:17:45

ranqingfa 发表于 2013-7-22 09:25 static/image/common/back.gif
本坛我有共享程序,你找找,小米遥控平衡车

找到了 谢谢

冬至_半边天、 发表于 2013-9-28 17:51:32

pww999 发表于 2012-9-22 23:59 static/image/common/back.gif
可以这样试试,或者你可以先用可调电阻测试一下L298正反转运作...,最组合代码
IN1=4;//接D4
IN2 =7;


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

还有你的6050是怎么放置的啊?

海之蓝 发表于 2013-10-30 11:32:42

狠好,不错( ⊙ o ⊙ )啊!

41257203 发表于 2013-11-17 23:13:32

编译老是出错,求解

41257203 发表于 2013-11-17 23:15:02

冬至_半边天、 发表于 2013-9-28 17:51 static/image/common/back.gif
大神真心不知道你EN 1 2怎么接线
l298不就是4个输入吗?怎么整出来6 个呢
我不会了。求大神指点啊 ...

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

zuzuhe 发表于 2013-12-3 18:51:44

加油啊不会编程啊

zuzuhe 发表于 2013-12-8 23:09:29

用了你的程序发现我的小车只有一个轮子转动 且只有一个方向 求指教
页: 1 2 3 4 5 6 7 [8] 9 10 11 12
查看完整版本: arduino摇控平衡车m2560+mpu6050+24l01 (已上传代码包)