Asked — Edited

I2c Compass/Accelerometer Lsm303dlh Help

Hi,

I've been playing around with this sensor and I haven't had any luck getting it to work with ARC. The Script I am using is this: I2CStart() I2CRestart() I2CWrite(0x3C) //write mag I2CWrite(0x30) //Select register OUT_X_L_M I2CStart() I2CReStart() I2CWrite(0x3D) //read mag I2CRead(Auto,8)

Even though I get a reading, it never changes I get the same thing until I remove power from it: I2C Response: 16 32 3 1 211 254 223 0

Some of the data sheets I have been reading: http://www.pololu.com/file/0J433/LSM303DLH.pdf http://www.pololu.com/file/0J434/LSM303DLH-compass-app-note.pdf

So far I am batting zero, has anyone else worked with this module before?

I'd appreciate any help with this


ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

United Kingdom
#9  

I2C changed a few months ago, I've yet to use I2CRead, I will have a look for the topic in which it was discussed when I get chance.

In the mean time it may be worthwhile to try changing the I2CRead commands to something like $gps=I2CRead(Auto,6) or maybe even $gps=I2CWrite(Auto,6). As far as I know, just using an I2CRead on it's own would be much like using a GetADC or GetPWM without storing it in a variable.