The accelerometer measures acceleration.How can you measure distance with an accelerometer?.
The accelerometer measures acceleration.
Velocity is the integral with respect to time of acceleration.
Distance is the integral with respect to time of velocity.
I'm aware of that - but an accelerometer only gives an output during acceleration, once you reach a steady speed it's of no help as there's no output.
If there is no acceleration then either the speed is some constant value or zero (not moving).
The processor should know what the state is and calculate from there.
So after a period of acceleration, the speed should be known, when the acceleration drops to zero the processor continues integrating the speed to calculate the distance travelled.
This is the sort of thing which submarines use for navigation when submerged, I have no idea what their accuracy is but the equipment to implement it is a bit bigger than a little accelerometer from RS/Farnell/Digikey coupled to a PIC on a bit of Veroboard!I'm very dubious about the accuracy of that!