From 377f58b6c03985df1513c8c321217fa25834c44d Mon Sep 17 00:00:00 2001 From: Manianac <2092573+manianac@users.noreply.github.com> Date: Thu, 31 Mar 2022 17:23:52 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Use=20ADC=5FVREF=20for=20Filamen?= =?UTF-8?q?t=20Width=20ADC=20Vref=20(#23977)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/filwidth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index e234380e981a9..9eb1e77762ff0 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -67,7 +67,7 @@ class FilamentWidthSensor { } // Convert raw measurement to mm - static float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } + static float raw_to_mm(const uint16_t v) { return v * float(ADC_VREF) * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } static float raw_to_mm() { return raw_to_mm(raw); } // A scaled reading is ready