How to coding with magnetic reed switch to calculate rainfall volume

Can anyone show me the code. I really need it.

(deleted)