8 years, 8 months ago.

l3g4200 gyroscope values not changing....

I've interfaced l3g4200d gyroscope to lpc1768 using i2c interface. Earlier i used to get random values based on angle but from yesterday, i am getting only 8360,0,0 values continuously. Even the function WHO AM I is not giving any output. Is it any problem with my module?

Here is the code <<include "L3G4200D.h" Serial pc(USBTX, USBRX); L3G4200D gyro(p9, p10);

int main() { int g[3]={0,0,0}; pc.printf("Now starting gyroscope test...\n");

Set highest bandwidth. gyro.setLpBandwidth(LPFBW_42HZ);

while (1) {

Arbitrary wait for printf clarity. wait(1); gyro.read(g); pc.printf("x=%d,y= %d,z= %d \r\n", g[0], g[1], g[2]);

}

}>>

1 Answer

8 years, 8 months ago.

If WHOAMI is not responding, then it's probably your wiring. Are you sure everything is wired up correctly?

Re: random values, are you sure you hooked it up to the right power pin (5V or 3.3V?).