I am trying to use a A3144 hall effect sensor with an Arduino MEGA 2560 to measure RPM of a fan. However, not only do I not get the RPM printing out to the serial monitor, but I do not get anything printing out to it. I have the digital input 1 connected to pin 3 of the sensor, ground connected to pin 2, and 5 V connected to pin 1. I also have a 10K ohm resister between pin 1 and 3 of the sensor. These connections are from the spec sheet and I attached the picture of it. I have also attached the code. I did not create the code and I am very new to Arduino.
Motor_Fequency_Measure.ino (1.26 KB)