Greetings!

What you need in this case is a first order digital low pass filter. Sounds complicated, but actually is quite simple. If you still haven't found a solution, p.m. me and I'll post one of my ready to use C functions for this.

how about you just post it instead of saying that you'll post it

// Return RC low-pass filter output samples, given input samples,

// time interval dt, and time constant RC

function lowpass(real[0..n] x, real dt, real RC)

var real[0..n] y

var real α := dt / (RC + dt)

y[0] := x[0]

for i from 1 to n

y

* := α * x** + (1-α) * y[i-1]*

return y

Here's a recursive implementation

http://www.edn.com/design/integrated-circuit-design/4323639/8-bit-microcontroller-implements-digital-lowpass-filter