basic library for calculating a moving average of a given pin voltage