I am using this example to take samples from accelerometer. Everything seems to work fine but the result what I get is something like (X-axis, Y-axis, Z-axis) = (~0.0, ~0.0, ~1.0). This result I get when I am not touching or moving my Connectport X5. Does anyone have an idea why Z-axis shows 1 G acceleration even though nothing should be happening?
If I change my device to lie in another position on the table, another axis goes around 1.0 or (~1.0). Is there some reset or something what I should do for the accelerometer or am I not understanding something correctly?
Another question is that does anybody know what is the measurement range of the CPX5 accelerometer? I tried to find this information from datasheets and from google. In every source I found is just written that it is “3-axis accelerometer”.
The total Gs should add up to 1 at rest, plus or minus some small variations.
Everything seems to work fine but the result what I get is something like (X-axis, Y-axis, Z-axis) = (~0.0, ~0.0, ~1.0)
What are the exact values are you getting?
Keep in mind that 1G = 1 gravity, which is what you (and the X5) experience sitting quietly at the table. You are probably expecting ‘acceleration’, but really the sensor is showing you the forces in 3 directions, which will include normal gravity.
Think of it this way - imagine using your game controller where you tip it to the left to turn a car left, tip right to turn right. You don’t want to have to keep shaking/snapping (accelerating) to the left to keep turning left. You want to ‘tip’ to the left and then the controller is now idle, no longer moving yet you want to know that it is tipped left. That’s why you’ll never see (0,0,0).