Hey, all!
I am trying to use mean function from this library: Arduino Playground - HomePage
So, i wanted to find the mean value from the obtained values of SPI reading function after 60 samples is obtained.
this is part of my code where i am using the mean function:
for(int count = 0; count<60; count++)
{
uint32_t IRdc =0;
uint32_t Reddc =0;
uint32_t IRheartsignal;
uint32_t Redheartsignal;
IRheartsignal = AFE4490Read(LED1VAL); //SPI reading register function
Redheartsignal = AFE4490Read(LED2VAL); //SPI reading register function
IRdc = mean ((IRheartsignal, count),DEC);
Reddc = mean ((Redheartsignal, count), DEC);
}
I just follow the use of mean function like on the example on the link : Arduino Playground - HomePage.
but when I compile it, i got this error:
bloodsaturation.ino: In function 'void setup()':
bloodsaturation:102: error: call of overloaded 'mean(int&, int)' is ambiguous
bloodsaturation.ino:24: note: candidates are: uint32_t mean(int*, int)
bloodsaturation.ino:32: note: uint32_t mean(uint32_t*, int)
bloodsaturation:103: error: call of overloaded 'mean(int&, int)' is ambiguous
bloodsaturation.ino:24: note: candidates are: uint32_t mean(int*, int)
bloodsaturation.ino:32: note: uint32_t mean(uint32_t*, int)
I checked again the source code, and it seems it provides mean function in several type (unsigned long, float, long, etc)
So, i think this cause an ambiguous when compiling.
Can someone please help me how is the correct way to use mean function?