L3G4200D and Rasberry Pi

Hello!
I am trying to access gyro measurements using Raspberry Pi and MinIMU-9. According to the datasheet (page 27) i see registers are read/wrote correcrly. For example CTRL_REG1:

root@raspberrypi:~# i2cget -y 1 0x18 0x20 b
0x07
root@raspberrypi:~# i2cset -y 1 0x18 0x23 0x0F
root@raspberrypi:~# i2cget -y 1 0x18 0x23 b
0x0f

But when i try to access measurement data (OUT_X_L) it always returns zero. As i understood examining C code here no special initialization needed if default parameters suit me fine. What’s the problem then?
Thanks for help!

Hi, awfun.

In the commands you posted, you initially query CTRL_REG1 (0x20), but then you write and verify CTRL_REG4 (0x23). That means you’re not actually enabling the gyro, which is likely why you don’t see any output.

- Kevin

Kevin,
all i need to start measurements is to set CTRL_REG1 to 0x0F, right?

However output registers contain only zeros

root@raspberrypi:~# i2cset -y 1 0x18 0x20 0x0F
root@raspberrypi:~# i2cget -y 1 0x18 0x20 b
0x0f
root@raspberrypi:~# i2cget -y 1 0x18 0x28 b
0x00

What’s wrong with my code ?

Yes, that should be all you need to do. It looks like you’re not using the right address, though: it should be 0x69, not 0x18. Sorry I didn’t notice that in your first post. I tested your commands with a Raspberry Pi and L3G4200D here using address 0x69 and they worked. (On ours, it appeared on I2C bus 0, not 1, but that might be different for newer RPis.)

- Kevin

kevin, thank you very much! it started working.
I should have tried all variants of addresses :unamused: