Measuring frequency using float switch

Hi, I am having an experiment and i need to determine the frequency of a water wave. I will be using a float switch, and I dont know how to code it. I want to count number of times the float switch will hit ON per second.

If you dont mind to code it, please do. I really dont know how to code, thanks!

why don’t you learn how to code? can be a useful skill…

Have a search for example code counting button presses. Pretty much the same logic as counting a float switch. Do you really mean waves per second? I've never seen water waves that fast....

(deleted)

Third thread on this topic since December.