Arduino ultrasonic sensor project I'm a newbie at Arduino, and I'm trying to make a project with ultrasonic sensor, I'm using the grove ultrasonic ranger, not the HC-SR04, and I already did test with distance and it worked very well, but now I need help with the code. 

I need to create a vector that save the values of the distance to after calculate the speed using distance/time calculus, but the case of my project its to use in open places, so will be times that the distance will be "max" because there's nobody in the range, so I need a condition to exclude those values of the array (the maximum distance printed when the sensor can't feel nothing is 516 cm)
I'm not experienced with Arduino coding, so please help me, in anex is my code for basic scanning.

#include "Ultrasonic.h"

Ultrasonic ultrasonic(7);
void setup()
{
    Serial.begin(9600);
}
void loop()
{
    long RangeInCentimeters;
    Serial.println("The distance to obstacles in front is: ");

    // two measurements should keep an interval
    RangeInCentimeters = ultrasonic.MeasureInCentimeters();
    if(RangeInCentimeters &gt; 400)
    Serial.print ("distancia nula");
    else
    Serial.print(RangeInCentimeters);//0~400cm
    Serial.println(" cm");
    delay(1000);
}
If you don't know how many data points will be recorded, look into vectors or an external storage device. Alternatively you could use a circular array if you don't mind losing recorded data after a while.

If you know how many data points will be recorded, a basic array will suffice.

As for excluding invalid values:

// Keep trying to get a valid data point 
While (RangeInCentimeters &gt; 512 &amp;&amp; RangeInCentimeters &lt; 400)
{
 delay(200);  // The minimum value of this delay depends on the sample rate of your sensor
 RangeInCentimeters = ultrasonic.MeasureInCentimeters();
}

//... Store data to array/linked list/etc


I changed your max range to 512 because this is likely the max real value (2^9 = 512).