Average of a sensor

Tom D,
Found this on this forum and I'm sorry to say I forgot to record the original senders ID, but it works well for me.
Changing the ratio of the decimal fractions changes the frequency of update.
TomJ

//Then I'd do a 'rolling average' of the form
//to smooth off the jitter.
//light1 is of type float)

Code:
light1 = light1 * 0.9 + float(analogRead(light1Pin)) * 0.1;