Then the speed would be acceleration times time?
plus the previous speed.
V
new = V
old + acceleration * delta_time
where delta_time is the difference between the old sample and the new.
Likewise with the position,
P
new = P
old + velocity * delta_time
This is an iterative process. Start out at rest with the old velocity and position equal to zero. Sample, calculate new velocity and position, old velocity and position are replaced with new velocity and position. do something with the data. Repeat forever.
delta_time is IMO the tricky part, as you'll want to sample fast to make the process more accurate, but that makes timing a bit more difficult as the time of the operations (sampling, calculations, output, etc) begin to dominate the time between samples.
-j