i am newbie in arduino and i have small project i read that pulseIn function return length of the pulse in microseconds and
frequency(HZ)=1/time(second)
so i hope below code to measure frequency value is correct otherwise please notify me
int senserpin=8;
int sensordelay=1000;
float duration;
float freq;
void setup{
pinMode(senserpin,INPUT);
serial.begin(9600);
}
void loop()
{
duration=pulsein(senserpin,high)
freq=1/(duration*1000000)// multiply duration *1000000 to convert from microseconds to seconds
serail.print("frequency");
serail.print(freq);
delay(sensordelay)
}