Measuring RPM using Hall sensor A3144

Does the code look okay now?

Does it produce reasonable results?

Most of your global variables should not be global.