diff --git a/libraries/AP_Scripting/drivers/VSPeak_flow_meter.lua b/libraries/AP_Scripting/drivers/VSPeak_flow_meter.lua index d884a1d8f4..e13b891ba9 100644 --- a/libraries/AP_Scripting/drivers/VSPeak_flow_meter.lua +++ b/libraries/AP_Scripting/drivers/VSPeak_flow_meter.lua @@ -99,7 +99,7 @@ function uint16_value(hbyte, lbyte) end function read_uart() - local n_avail = uart:available() + local n_avail = uart:available():toint() -- Discard up to BUFFER_LEN bytes. -- These are stale data.