Jump to content

How to get a moving average?


BrianC

Recommended Posts

I am taking pressure values from a pump. I need to store the value every time I call a function (.7 seconds) and take the average of the last 7 values. I only care about getting a ~5 second average, then I can forget the numbers. I need to do this for several values, so something reusable would be great. I cannot seem to figure out an easy way to accomplish this. Any help is appreciated.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.