Goodafternoon,
I want to read values form a microphone (microphoneAdafruit MAX9814) ofconnected to the Analog port A0 from Arduino and store the values that are incoming inside an array.
After the values are storesstored in the array, I want to read out the values and store the average of the hole arraynumber that is repeated most time in a valuevariable. Is this possible and how to achieve this? The size of the array I doesn't know.
I came up with the following:
const int micPin = A0;
int soundArray[];soundArray[10];
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(micPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int micValue = analogRead(micPin);
Serial.println(micValue, DEC);
//delay(400);
for (int i = 0; i > 8;10; i++) {
soundArray[i] = micValue;
Serial.println(soundArray[i]);
}
delay(1000);
Serial.println("End of for loop");
}
The problem now is that a value of the microphone will be repeated 10 times. So I will receive 10 times the following error:number 234 for example. See image.
Sound_V1.ino:6:16: error: storage size of 'soundArray' isn't known
Error compiling.
This is not what I want. I want to get different numbers in the array of that moment.

Hope someone can help me out. Thanks in advance.