Hi all,
Long time lurker here, but unfortunately my first post had to be a question ![]()
I see that questions about Average.h has been asked a few times, but I couldn't find any solution to it, so I hope we can get somewhere with this thread.
For some odd reason, Average.h does not work as shown in the examples. Yes, the demo sketch in the library compiles, but I can't see a proper way to implement that method. The example provided on this site does not compile at all:
error: 'mean' was not declared in this scope
 Serial.print(mean(d,CNT),DEC);
and so on for all methods.
What I try to do, is getting a maximum and minimum value from an array of floats, like this:
#include <Average.h>
float tester[] = {10.23, 43.87, 14.98, 0.27}; // Array of 4 values as an example
int aLength = 4;Â // 4 values in the array
void setup() {
 Serial.begin(9600);
}
void loop() {
 Serial.println(maximum(tester, aLength));
 Serial.println(minimum(tester, aLength));
}
Of course, this fails in the samme manner as "maximum" and "minimum" is not declared, but shouldn't it already be declared in Average.h?
If the library was updated and that example is no longer valid; how would you be able to do this then? I see that the library-provided example has this line:
Average<float> ave(10);
I think this suggests that the array must be declared by Average.h, but that doesn't work either.
I'm at a loss here, so I hope anyone can help me out. I might have to make my own routine to find min and max values if Average.h doesn't work.
Thanks in advance ![]()