Calculating a running average

Hi I am bringing in a value from an external sensor at a rate of one reading per second.
I would like to have a continuous reading of the average sensor reading per minute.
What is the best way to constantly update an average like this…and how do I get Unreal to wait until the new incoming sensor reading before adding the newest value to the calculation ?

If I understand correctly, you’d like to have averages over 60-second periods. I’m assuming the sensor data is simply a value that you read, so I would just recommend you set a timer to check the value every 0.75 seconds or so (To allow for frame-time error/delay), and that is where you’d check to see if the value has changed, and if so, add it to the calculation and average it out.

Hi - I would like the average to be called upon at any stage - not just at 60 second intervals.
The sensor data is a serial read value. Sometimes the sensor values are the same as the previous reading (its a heart rate monitor) so putting in an if statement to see if the newer value differs from the previous value won’t be an option.
Does anyone have a blueprint created with a large array whereby once the last array is stored or written over it begins writing over the first array in the list. And every time a new number is stored in the array and average is calculated ?

I’ve done this quite a bit. Add the value to the array and do an if length is greater than 60 then remove element 0 each time a value is added. Use a looping timer to grab the data.

Hi Dannington - is there any chance you could post a screenshot of a similar blueprint ?