@kolaha
That disables also sending text from the Serial.print(). Have you tried to compile it ?
@georgepa
A Serial.begin(115200); is missing in setup(), and Count should be 'volatile'.
I think that the calculation is okay. To get 100 km/h you need about 320 pulses. Where do those 320 pulses come from ? Do you have a oscilloscope to measure the signal ? Is the GND wire not connected ?
You have to measure somehow if that is a normal 0...5V signal with a few pulses, or just a lot of noise, or really 320 pulses.
If you have another Arduino board and let it output a frequency of 20 Hz and feed that to your Mega board, then I'm sure it will show normal values.
Can you please post some images of your project?
So we can see your component layout.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Not a Fritzy picture but your own schematic of your project, reverse engineer your project.
Your debouncing needs to take place where you actually have a signal being received, not every pass through loop(). Put it in the interrupt code where the signal is actually being received.
If the pulse generator is a Hall effect sensor with NPN open collector output, the signal should not bounce unless the pullup is too weak. Post a datasheet link or brand name and exact part number for your anemometer.
I was also confused by the "debounce", but that should be called the "interval". It is the interval of 1 second to collect the Count from the interrupt. Debounce has nothing to do with it.
Thank you very much for the code, but I have a little problem, this is part of a larger project and I can't add any delays, and also I'm not skilled enough to modify the code to not use the delays. Can you also help me here please?