hi everyone i try to program my RM-G146 chip with acce, gyro and magnetometer and this is my code...i only tried to get data from my accelerometer but my ouput is always zero... and i dont know whats wrong... please help...this is the device http://www.roboard.com/G146.html
#include "Wire.h"
#define gyro_addr 0xD0
#define magne_addr 0x3C
#define acce_addr 0x30
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void getdata_gyro()
{
}
void getdata_acce(byte *a, byte *b)
{
Wire.beginTransmission(acce_addr);
Wire.send(0);
Wire.endTransmission();
Wire.requestFrom(acce_addr, 2);
*a = Wire.receive();
*b = Wire.receive();
}
void getdata_magne()
{
}
void loop()
{
byte aa, bb; //variables for storage
getdata_gyro();
getdata_acce(&aa, &bb);
getdata_magne();
Serial.print("a= ");
Serial.print(aa, HEX); //prints the value of aa
Serial.print("\n b=");
Serial.print(bb, HEX); //prints the value of bb
}