Correct, count the number of pulses. Each pulse = .011" (.2794mm) of rain. This could be done with a general IO interrupt, or just poll it frequently if your main loop is quick and the pulse length is long. Hook it up to a scope if you have one to measure it.
Correct. There are only 16 discrete positions that can be identified, so you will need to set up the logic to identify which position based on the which value is closest to the actual ADC value. Even an 8bit ADC value should be more than enough.
COUNT would work well here. (COUNT PORTB.2, 1000, WindSpeed). Multiply pulses by 1.492 for MPH or 2.4 for KM/H. However, the problem with this is that you may miss the Rain Gauge pulse while the COUNT command is busy for the 1000 milliseconds. Again, it depends on how long the pulse is from the Rain Gauge, and if you are using an interrupt to catch the pulses.
There are a number of different ways this can be done and you would have to modify the multipliers to integer values. Hope this helps get you started.





Bookmarks