Arduino code to measure RPM