I am trying to write some code to read the speed of a fan (RPM) from the signal output of a CPU fan without using interrupts with the arduino. Is there any code available that can do this easily? Can someone get me started or show me a block of code that will do this for me? Thank you so much.
unsigned long interval = pulseIn(pulsePin, HIGH) + pulseIn(pulsePin, LOW); // Pulse interval in microseconds int RPS = 1000000UL / interval; // Pulses per second