There are quite a few magic numbers in the program.
1.Why the envelope value should be 4000
4000 is the timer1 count I chose to give me the best result
2.Why the ZCD value should be 3000
3000 is the timer1 count I chose it to be less than the envelope above to give me the best result
3.I think the untrasonic transducer send pulse for 0.64ms
The output from the schmit trigger stays on after the .64ms pulse. This is caused by the ringing of the
transducer which causes the received signal to be nearly twice as long as the transmitted .64
4. In this equation windstep = (sqrt((207.36E6 + Exts*Exts)) - 14400.0)*3.6
3.6 is a scale factor to give the windspeed step as km/s
5. In this function float wind = (windstep * diffav)/110000.0
110000 is the timer 1 count that I use to give the number of the wind step.
Its an average value that I found to give the best result.
I wish now I had specified all my magic numbers in the program.