Hi, I am new here, I just get some problem with my anemometer pulse output which type is QS-FS02, so I just have the code, but I didn't know why Ardunio Mega 2560 can't read the pulse.
there are 3 cable: brown to 5v, black to gnd, blue to pin5.
please Help, there is something wrong in my code?
#include <FreqCounter.h>
float frq;
int freq1;
int pinLed=13;void setup() {
pinMode(pinLed, OUTPUT);Serial.begin(9600); // connect to the serial port
Serial.println("Frequency Counter");
}
void loop() {
// wait if any serial is going on
FreqCounter::f_comp=10; // Cal Value / Calibrate with professional Freq Counter
FreqCounter::start(1000); // 1000 ms Gate Timewhile (FreqCounter::f_ready == 0)
frq=FreqCounter::f_freq;
Serial.print(" Freq: ");
Serial.println(frq);
freq1=(frq*0.428989)+0.944195;
if(freq1<=0.944195) freq1=0;
Serial.println(freq1);delay(20);
digitalWrite(pinLed,!digitalRead(pinLed)); // blink Led}