Hey guys so essentially what im trying to do is store the altitudes in an array where i can access the numbers. Let me see if i can clarify that, so the arduino gives me relative altitudes on intervals(delay of what i choose for this example delay(1000)) of a second. The numbers look like
-.17
.10
-.24
.20
.18
-.09
etc etc So theres a considerable amount of noise in the detector. I want to store the values that it reads out in an array or something so i can add all those values up take the average and display that. But i cant figure out how to do that. i tried doing
for(i = 0; i <10;i++)
{
alt1 = a;
}
then when i print it using
for(i = 0; i <10; i++)
{
Serial.print(" ");
Serial.print(alt1*);*
Serial.print("\n\n");
}
i get something like this
Relative altitude is : -.24
-.24
-.24
-.24
-.24
-.24
-.24
-.24
-.24
-.24
-.24
So the for loop is being populated but by the same reading. I want it to store the reoccuring measurements. So that the loop could be something like
-.24
-.36
.89
so on and so forth. From there i would add the index's together then take the average. But im completely lost.