From ab1d54745d6b8f90356d48abb9479e14cf65e216 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Wed, 14 Apr 2021 18:55:54 +0100 Subject: [PATCH] AP_WindVane: convert analog sensor to use latest value --- libraries/AP_WindVane/AP_WindVane_Analog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_WindVane/AP_WindVane_Analog.cpp b/libraries/AP_WindVane/AP_WindVane_Analog.cpp index dcec6ed203..004767ab56 100644 --- a/libraries/AP_WindVane/AP_WindVane_Analog.cpp +++ b/libraries/AP_WindVane/AP_WindVane_Analog.cpp @@ -27,7 +27,7 @@ AP_WindVane_Analog::AP_WindVane_Analog(AP_WindVane &frontend) : void AP_WindVane_Analog::update_direction() { _dir_analog_source->set_pin(_frontend._dir_analog_pin); - _current_analog_voltage = _dir_analog_source->voltage_average_ratiometric(); + _current_analog_voltage = _dir_analog_source->voltage_latest(); const float voltage_ratio = linear_interpolate(0.0f, 1.0f, _current_analog_voltage, _frontend._dir_analog_volt_min, _frontend._dir_analog_volt_max); const float direction = (voltage_ratio * radians(360 - _frontend._dir_analog_deadzone)) + radians(_frontend._dir_analog_bearing_offset);