Hey jorge,

Hope it works out for you.
The only thing it's missing is hysterisis. No matter how much you average, there's always a point where the reading bounces back and forth between two digits.

To illiminate that "wobble", I added some hysterisis to the averaging routine and posted them a couple times ...

http://www.picbasic.co.uk/forum/showthread.php?p=13267

Never did get a response, but I've used them myself since then so at least now I can say that they do work.

HTH,