2017-02-14 04:03 AM
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#lis2dh122017-02-14 04:58 AM
What exactly do you mean by '
my Arduino console also shows me that ´X´and `Y` axis are enabled throughout the 0x31 register'? What value do you read?
I don't see anything wrong in your sensor configuration.
2017-02-14 05:37 AM
Regarding my Arduino Console I meant the UART values through Cool Term for example.
With this configuration when I receive an interrupt (We only receive it when the Z axis is over 1g, so it works perfectly) and therefore by reading the register 0x31 the values I get are the following ones:
01100101
So we have at one the bits:
-Interrupt Active
-Zh
-Yl
-Xl
We were wondering if it is normal that after disabling X and Y for reading and activating only interruption on Zh, the values for Yl and Xl in the register 0x31 are 1. It is just only that, the system is working fine.
Thank you!
Regards,
Toni
2017-02-14 08:01 AM
The sensor is working fine. The whole INT1_SRC register is updated even if some axis are disabled.