Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with getting Raw values from GY-85 IMU

Status
Not open for further replies.

wiki.

Newbie level 3
Newbie level 3
Joined
Sep 28, 2012
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
Hello,
i am at the very first stage.i am just taking raw values from the accelerometer of GY-85IMU,it uses ADXL345.
But the problem is that it is giving me same value on Z-axis in every orientation.
This is the code:

#include <ADXL345.h>
#include <bma180.h>
#include <HMC58X3.h>
#include <ITG3200.h>
#include <MS561101BA.h>
#include <I2Cdev.h>
#include <MPU60X0.h>
#include <EEPROM.h>

//#define DEBUG
#include "DebugUtils.h"
#include "CommunicationUtils.h"
#include "FreeIMU.h"
#include <Wire.h>
#include <SPI.h>


int raw_values[9];
float conv_values[9];
float ypr[3]; // yaw pitch roll
char str[256];
float val[9];
float values[9];

FreeIMU my3IMU = FreeIMU();
//The command from the PC
char cmd;

void setup() {
Serial.begin(115200);
Wire.begin();
my3IMU.init(true);

// LED
pinMode(13, OUTPUT);
}


void loop() {

for(uint16_t i=0; i<500; i++)
{
my3IMU.getRawValues(raw_values);
Serial.print('\n');
Serial.print("RAccX="); Serial.print(raw_values[0]); Serial.print(" ");
Serial.print("RAccY="); Serial.print(raw_values[1]); Serial.print(" ");
Serial.print("RAccZ="); Serial.print(raw_values[2]); Serial.print(" ");
Serial.print('\n');
Serial.print('\n');

}


while(1){};
}

can u tell me what is the problemm???
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top