Jump to content

How to get a moving average?


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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...