Wind direction
Closed this issue · 4 comments
Hi,
can you explain me how do you calculate the wind direction?
Kind regards Johannes
Not certain I understand "how to calculate?" Do you mean a low level understanding of the voltage divider operation? Perhaps you mean "how to calibrate or align?". I want to give you the answer you are looking for :)
I tried to comprehend the calculation of the analogCompare[15]
values related to the windDirText[15]
.
If I try to calculate the values the highest value would be on 270°
Obviously, you can orient the vane any way you wish. I would suggest you create a simple standalone sketch that continuously outputs values and directions for reorientation though. Mark your 270 position with a dot.
Code overview: There are 16 positions to deal with. I set the position found to the highest ADC value and read the ADC port. I iterate through the other 15 values from low to high to "prove me wrong" that I'm not at position 16.
Let me know if this does not make sense.
Thanks for your explanation. Now it's clear for me.