Dual Hbridge icon Dual Hbridge — Two-channel Dual H-Bridge movement panel to control two DC motors (on/off) for forward, reverse, left, right via EZ-B digital ports; no PWM speed. Try it →
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: https://www.pololu.com/file/0J433/LSM303DLH.pdf https://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

Stay at the forefront of robot programming innovation with ARC Pro, ensuring your robot is always equipped with the latest advancements.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#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.