6DOF shield ITG3205+ADXL345和Arduino Yun

2014-02-218847
AI 快速预览详细 收起
本文讨论了将6DOF盾ITG3205+ADXL345连接到Arduino Yun时遇到的avrdude错误。通过具体调试发现,该错误是由于缓冲区内存访问不支持导致的,可能是设备类型识别错误。文章提供了详细的故障排查步骤和解决方案,包括检查设备类型、重新安装驱动程序或更换USB线缆。通过这些方法,您可以快速解决上传代码时遇到的问题,避免重复踩坑。
把6DOF直接插在Yun上,然后用例子代码:

////////////////////////////////////////////////////////////
// Arduino firmware for use with FreeSixCube processing example
////////////////////////////////////////////////////////////

#include <FreeSixIMU.h>
#include <FIMU_ADXL345.h>
#include <FIMU_ITG3200.h>

#define DEBUG
#ifdef DEBUG
#include "DebugUtils.h"
#endif

#include "CommunicationUtils.h"
#include "FreeSixIMU.h"
#include <Wire.h>


float q[4]; //hold q values

// Set the FreeIMU object
FreeSixIMU my3IMU = FreeSixIMU();

void setup() {
  Serial.begin(115200);
  Wire.begin();

  delay(5);
  my3IMU.init();
  delay(5);
}


void loop() {
  my3IMU.getQ(q);
  serialPrintFloatArr(q, 4);
  Serial.println(""); //line break

  delay(60);
}



上传时报错如下:

Sketch uses 15,284 bytes (53%) of program storage space. Maximum is 28,672 bytes.
Global variables use 522 bytes (20%) of dynamic memory, leaving 2,038 bytes for local variables. Maximum is 2,560 bytes.
Found programmer: Id = "S"; type = p
    Software Version = V. ; Hardware Version = v.

avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
processing.app.debug.RunnerException
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:129)
        at processing.app.Sketch.upload(Sketch.java:1672)
        at processing.app.Sketch.exportApplet(Sketch.java:1578)
        at processing.app.Sketch.exportApplet(Sketch.java:1550)
        at processing.app.Editor$DefaultExportHandler.run(Editor.java:2399)
        at java.lang.Thread.run(Unknown Source)
Caused by: processing.app.debug.RunnerException: Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
        at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:113)
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:127)
        ... 5 more


请问这是什么情况?该如何解决?


创作许可协议

本项目采用 None(不开放任何权利,保留所有权利) 进行许可。

评论(2)
Grey
Grey
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
好像可以通过更改串口,或者避免使用USB3.0 来解决这个问题
futuremeng
futuremeng
作者
// # Editor : Roy from DFRobot
// # Date : 10.12.2013
// # E-Mail : [email]roy.yu@dfrobot.com[/email]
// # Product name: 6 Dof shield for Arduino
// # Product SKU : DFR0209
// # Version : 0.1
// # Description:
// # The sketch for driving the 6 Dof shield for Arduino via I2C interface
#include
#include
#include
#include
int16_t angle[2]; // pitch & roll
// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();
int rawSixDof[6];
void setup()
{
Serial.begin(9600);
Wire.begin();
delay(5);
sixDOF.init(); //begin the IMU
delay(5);
}
void loop() {
sixDOF.getRawValues(rawSixDof);
for (int i=0; i<6; i++) //output the raw data
{
switch (i)
{
case 0:
Serial.print("Acc.x :");
break;
case 1:
Serial.print("Acc.y :");
break;
case 2:
Serial.print("Acc.z :");
break;
case 3:
Serial.print("gyro.x :");
break;
case 4:
Serial.print("gyro.y :");
break;
case 5:
Serial.print("gyro.z :");
break;
default:
Serial.print("Err");
}
Serial.println(rawSixDof[i]);
}
Serial.println("");
angle[0] = _atan2(rawSixDof[0],rawSixDof[2]);
angle[1] = _atan2(rawSixDof[1],rawSixDof[2]);
Serial.print("X:"); //pitch & roll
Serial.println(angle[0]/10.0);
Serial.print("Y:");
Serial.println(angle[1]/10.0);
Serial.println("");
delay(1000);
}
int16_t _atan2(int32_t y, int32_t x) //get the _atan2
{
float z = (float)y / x;
int16_t a;
if ( abs(y) < abs(x) )
{
a = 573 * z / (1.0f + 0.28f * z * z);
if (x<0)
{
if (y<0) a -= 1800;
else a += 1800;
}
}
else
{
a = 900 - 573 * z / (z * z + 0.28f);
if (y<0) a -= 1800;
}
return a;
}
这个可以,来自http://www.dfrobot.com/wiki/index.php/6_Dof_Shield_(DFR0209) 还没明白什么意思,先能跑了再说,呵呵。
下面这个也可以,来自6 Dof shield library\FreeSixIMU\examples\sixDOF_Example
#include
#include
#include
#include
float angles[3]; // yaw pitch roll
// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();
void setup() {
Serial.begin(9600);
Wire.begin();
delay(5);
sixDOF.init(); //begin the IMU
delay(5);
}
void loop() {
sixDOF.getEuler(angles);
Serial.print(angles[0]);
Serial.print(" | ");
Serial.print(angles[1]);
Serial.print(" | ");
Serial.println(angles[2]);
delay(100);
}
- 没有更多了 -