AnsweredAssumed Answered

LIS2DH12

Question asked by tonibco on Feb 14, 2017
Latest reply on Feb 14, 2017 by Miroslav B

Hi all,

I have got a technical question, if is possible to get some helpful feedback, I would really appreciate it, please.

I have recently purchased a LIS2DH12 accelerometer and I am plugin it within a Teensy module in order to check the right behaviour. I have only enabled ´Z´axis by 0x20 and 0x30 registers.  However, my Arduino console also shows me that ´X´and `Y` axis are enabled throughout the 0x31 register. So, my question is: Which registers should I configurate and keep in mind for just activate ´Z´axis?

 

Well, my Register configuration is the following one;


while(i2cWrite(0x20, 0x34, true));
while(i2cRead(0xA0,i2cData,1));
Serial.println(i2cData[0],HEX);

 

while(i2cWrite(0x22, 0x40, true));
while(i2cRead(0xA2,i2cData,1));
Serial.println(i2cData[0],HEX);

 

while(i2cWrite(0x23, 0x08, true));
while(i2cRead(0xA3,i2cData,1));
Serial.println(i2cData[0],HEX);

 

while(i2cWrite(0x32, 0x3F, true)); //INT1 Threshold --> 0x3F (63 dec) * 16mg = 1g //  
while(i2cRead(0xB2 ,i2cData,1));
Serial.println(i2cData[0],HEX);

 

while(i2cWrite(0x33, 0x02, true)); //INT1_DURATION
while(i2cRead(0xB3,i2cData,1));
Serial.println(i2cData[0],HEX);

 

while(i2cWrite(0x30, 0x20, true)); //INT1_CONFG --> Enable interrupt generation on Z high event or on direction recognition
while(i2cRead(0xB0,i2cData,1));
Serial.println(i2cData[0],HEX);


Thank you very much for your help before hand,

Toni

Outcomes