RobTillaart / RunningAverage

Arduino library to calculate the running average by means of a circular buffer.
MIT License
53 stars 10 forks source link

General question #22

Closed ahmetcemturan closed 1 year ago

ahmetcemturan commented 1 year ago

Hi Rob, I would like to know whether the ringbuffer lnegth is settable (like with the Running Angle). Also is the code ready for production? I like the max min option a lot and would like to use it. (Along with a settable length)

RobTillaart commented 1 year ago

Thanks for the question, As Iam quite busy it may take some time to answer the questions.

RobTillaart commented 1 year ago

I would like to know whether the ringbuffer lnegth is settable (like with the Running Angle).

You can set the size in the constructor.

Also is the code ready for production?

The code is stable for quite some time now. There is no warranty, so use it at your own risc (see MIT license). That said if there are bugs or other problems you can always open an issue and I will try to help.

I like the max min option a lot and would like to use it.

Best is to first make a small prototype to verify if the library meets your requirements.

ahmetcemturan commented 1 year ago

How could I have missed that :( I have implemented t now for a weather station where I measure 3 different lengths of averages for the wind. 1min, 5min and 10min average alng with the respective max and min winds. I noticed that the max and min values have to be reset after these periods as there is basically no "period" in the rolling buffer..

RobTillaart commented 1 year ago

I noticed that the max and min values have to be reset after these periods as there is basically no "period" in the rolling buffer..

You can use getMinInBuffer() and getMaxInBuffer()

but getMin() returns minimum since last clear(), think of it as minimum since (re)start of the measurements.

ahmetcemturan commented 1 year ago

Oh great, you are so helpful... Thanks a lot.

RobTillaart commented 1 year ago

If there are no more questions, you may close the issue.