04-30-2020 05:26 PM - edited 04-30-2020 05:46 PM
I am using a bmx055 and I would like to detect when the sensor is at a flat position.
According to the datasheet, the ACC register 0X0C detects if the sensor is at a flat position.
I am using the Arduino IDE and doing the following set of instructions to detect if the sensor is flat.
writeByte(BMX055_ACC_ADDRESS, 0x16, 0x80); //enable flag to flat detection
byte c = readByte(BMX055_ACC_ADDRESS, 0x0C) & 0x80; // get byte from register, perform AND bitwise to retrieve only the flag bit.
I have been able to detect the flat position but the angle range is a bit higher than the desired. Is it possible to set the range to another value? The register 0x2E contains the threshold if I am not mistaken, but I can't figure how to translate the range of 0 to 44.8º into the byte that fits the address
How can I detect if the sensor is at a flat position with an error of +/- 2º for example?
Solved! Go to Solution.
05-01-2020 04:26 PM