Arduino Pro and Anemometer (Reading Pulse Times)

Are you sure your wind vane uses a reed switch? Don't think I've ever seen one of those, unless it uses several switches to indicate wind sectors.

Yes, it does implement reed switches. Two in fact (one associated with the three cup system and one for the wind vein). You can find speed relative to one switch and seeing how fast the switch turns on and off. To find direction you have to measure the shift between the two pulses.

The answer to the first question is yes. But, I wouldn't. I'd use 4 and 5. Or use 2 and 3, but attach interrupt handlers to the two pins (they are the external interrupt pins). Each ISR would fire on the RISING edge or the FALLING edge. In each ISR, record when the interrupt occured. In loop, look at the relative times.

I guess I am just confused on how the data will be stored. If I attach my pins to 2 and 3 using and use 2 attathinterrupts instead of two

attachInterrupt(0, arduino_anemometer, RISING);
attachInterrupt(1, arduino_anemometer, RISING);

in my loop function if digital pin 2 triggers on the rising and digital pin 3 rises while pin 2 is high, will the data I have for stored while using Pin 2 be erased?

for example...

//Calculating Speed Duration
SpeedDuration = (millis() - SpeedTimePrevious);
SpeedTimePrevious = millis();

if (SpeedTimePrevious > DirectionTimePrevious)
{
DirectionDuration = (millis() - DirectionTimePrevious);
DirectionTimePrevious = millis();
DirectionTimePeriod = (DirectionTimePrevious - DirectionTimePrevious1);
}

// Calculates Frequency between DIRECTION signals
DirectionTimePrevious1 = DirectionTimePrevious;
Frequency = 1/DirectionTimePeriod;

// Calculates time difference between SPEED and DIRECTION signals
if (DirectionTimePrevious != 0 ) // Ensures that Direction must occur second
{
TimeDifference = (SpeedTimePrevious - DirectionTimePrevious);
}

I would only want my SpeedDuration to trigger only when pin 2 rises. Does that mean I have to create a new subroutine outside of loop to account for this? Will this data be erased when pin 3 triggers with an interrupt? Can I compare the Time Difference in the loop if they are being handled in the interrupt subroutine?