Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: LSM303 problem on: August 05, 2011, 12:06:40 pm
you tried using 3.3v?


Yes, I have connected VIN to 3.3v but my code doesn't work.
Any idea?
Thanks.
2  Using Arduino / Sensors / Re: LSM303 problem on: August 02, 2011, 01:44:20 pm
Yes, the void LSM303DLH::enable(void) function is only in the library
3  Using Arduino / Sensors / Re: LSM303 problem on: July 30, 2011, 03:56:13 am
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?
4  Using Arduino / Sensors / LSM303 problem on: July 29, 2011, 03:10:03 am
I am using the LSM303DLH board from pololu, I am working on an arduino uno and I have connected the sensor in the following way:
                   Uno      LSM303DLH
                    5V  ->  VIN
                   GND  ->  GND
          Analog Pin 5  ->  SCL
          Analog Pin 4  ->  SDA

The library https://github.com/ryantm/LSM303DLH doesn’t work for me, I can’t interface the sensor by using the Wire library because my arduino freezes at Wire.beginTrasmission().
Any idea?
Does this breakout board work at 5V or at 3.3V?
Thanks.
5  Using Arduino / Sensors / interfacing LSM303DLH on: July 12, 2011, 04:27:39 am
Hi,
I am a newbie, this is my first post. I am working on a Arduino Uno with a Pololu LSM303DLH 3D Compass and accelerometer; in order to read the sensor I use this library https://github.com/ryantm/LSM303DLH but it returns raw data.
How can I convert accelerometer raw data into mg (or g) ?

Thanks,
Daddym85
Pages: [1]