I'm trying to time a hall effect sensor on-off when a magnet passes. All I get from the output is "0". Tried a number of things but no good results. Sensor is a 44E001. Thanks in advance for the help. Sketch is below:
If the suggestions of @red_car do not solve your issues:
Google finds nothing for that number. Post a data sheet for that sensor.
Please post a schematic of the project. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.
I've been trying to learn how to use an interrupt routine since I never used one. I've given up and went back to using state-change that I used to check an IR sensor in a previous sketch. I just switched to a hall effect sensor. Thanks for all the help. Here's my final code that works fine:
nope - the calculated time has nothing to do with the interval between pulses, because you save the startTime in incorrect moment
You should store the millis() to the startTiime when count =1
I think you might be right. There are two magnets on the shaft so then if I check time after three pulses, I should get the time for a full revolution. Thanks for the suggestion.