Using Wind direction as a PWM output?

Hey everyone,

I posted this over on the 4.0 section but was informed that the wind direction feature is only available in the 4.1 beta.

I have two quads, one with a cube orange and another with a cube black. I’m not running any external wind sensors on either but I’m looking for a way to utilize the wind direction value as a PWM output to a servo to rotate a light array for use by a visual observer. I am a bit out of my depth and experience level with this so I’m hoping the collective knowledge can kind of point me in the right direction.

Is there a way to grab the wind direction value using a LUA script and output it as a PWM value? Where would you start to find the wind direction to even pull it as a data point? Is there a function to set a waypoint to weathervane into the wind?

Any rough ideas on achieving this would be greatly appreciated, thanks!