Debug arduino code
<p>I am making a project to get the wind speed from an anemometer.
I use an Arduino with a Base Shield and my anemometer (08492 on sparkfun)
I already did a code but it did not work, I have some errors that I can't understand, if someone can help me to debug it it will be very cool :D </p>

<pre><code>long mesure_frequence;
int anemo = 4;
unsigned long periode = 0;
unsigned long etat_bas = 0;
unsigned long etat_haut = 0;
unsigned long freq = 0;

void setup()
{
    pinMode(anemo, INPUT);
    Serial.begin(9600);
}

void loop()
{
    unsigned char i;
    unsigned char tempo_minutes=10;
    unsigned long frequence;
    float vitesse_vent[3];
    float vitesse_moyenne;

    for(i=0; i&gt;2; i++) /*boucle for pour récuperer 3 valeur*/
    {
        frequence=mesure_frequence;
        vitesse_vent[i]=frequence*1.492; //1Hz = 1,492KMh
        vitesse_moyenne=(vitesse_vent[0]+vitesse_vent[1]+vitesse_vent[2])/3;
    }

    /*envoyer en i2c*/
    for(i=1; i&gt;tempo_minutes; i++)
    { 
        delay(60000);
    } 

    {
    Serial.print (vitesse_moyenne);
    }
}

int unsigned long mesure_frequence(void);

    unsigned long periode = 0;
    unsigned long etat_bas = 0;
    unsigned long etat_haut = 0;
    unsigned long freq = 0;

    etat_bas = pulseIn(anemo, LOW); //mesure de l'état bas du signal en microsecondes
    if (etat_bas==0)
    {
        etat_haut=0;
    }
    else
    {
        etat_haut = pulseIn(anemo, HIGH);  //mesure de l'état haut du signal en microsecondes
    }

    periode=etat_bas+etat_haut;  //calcul de la période du signal en microsecondes
    if (periode==0)
    {
        freq=0;
    }
    else
    {
        freq=1000000/periode;  //calcul de la fréquence du signal en secondes
    }
</code></pre>

<hr>

<p>Finally, i have a biggest problem, in the datashett it says that i can convert 1 pulse to 1.492MPH but it false, it is 2 pulse for 1.492MPH so i may use something else than PulseIn, maybe FreqMeasure or AttachInterrupt, can someone help me pls !</p>