i have this wind speed sensor
i connected to arduino mega digitsl pin 5 to record wind speed every 1 min. i would like to make sure that below code is OK before run it
#include <FreqCounter.h>
void setup() {
Serial.begin(57600); // connect to the serial port
Serial.println("Frequency Counter");
}
long int frq;
float wind_speed
Void loop() {
FreqCounter::f_comp= 8; // Set compensation to 12
FreqCounter::start(100); // Start counting with gatetime of 100ms
while (FreqCounter::f_ready == 0) // wait until counter ready
frq=FreqCounter::f_freq;//read frequency value
wind_speed=(freq*0.765)+0.35; // calculate wind speed
Serial.println(wind speed); // print result
delay(1000);
}
important information about sensor attached