the board has the pullup resistors.
Is it hanging when you call the enable function?
I supply 3.3V to it haven't tried the 5V
Yes, my arduino is hanging when I call the enable function. It freezes at Wire.beginTrasmission.
My code comes from the example:
#include <Wire.h>
#include <LSM303DLH.h>
LSM303DLH compass;
void setup() {
Serial.begin(9600);
Wire.begin();
compass.enable();
}
void loop() {
compass.read();
Serial.print("A ");
Serial.print("X: ");
Serial.print(compass.a.x);
Serial.print(" Y: ");
Serial.print(compass.a.y);
Serial.print(" Z: ");
Serial.print(compass.a.z);
Serial.print(" M ");
Serial.print("X: ");
Serial.print(compass.m.x);
Serial.print(" Y: ");
Serial.print(compass.m.y);
Serial.print(" Z: ");
Serial.println(compass.m.z);
delay(100);
}
void LSM303DLH::enable(void)
{
//Enable Accelerometer
Wire.beginTransmission(ACC_ADDRESS);
Wire.send(CTRL_REG1_A);
//0x27 = 0b00100111
// Normal power mode, all axes enabled
Wire.send(0x27);
Wire.endTransmission();
//Enable Magnetometer
Wire.beginTransmission(MAG_ADDRESS);
Wire.send(MR_REG_M);
//0x00 = 0b00000000
// Continuous conversion mode
Wire.send(0x00);
Wire.endTransmission();
}
Can I try to supply 3.3V?