From 50f44d92490b1a39d471a01333a2a12e90023eda Mon Sep 17 00:00:00 2001 From: David Forrest Date: Wed, 29 Jan 2014 23:23:18 -0500 Subject: [PATCH] createTemperatureLookupMarlin.py: Truncate to short after application of OVERSAMPLENR for improved resolution. --- Marlin/createTemperatureLookupMarlin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/createTemperatureLookupMarlin.py b/Marlin/createTemperatureLookupMarlin.py index bf24dc652..d19430b82 100755 --- a/Marlin/createTemperatureLookupMarlin.py +++ b/Marlin/createTemperatureLookupMarlin.py @@ -143,9 +143,9 @@ def main(argv): for temp in temps: counter = counter +1 if counter == len(temps): - print " {%s*OVERSAMPLENR, %s} // v=%s r=%s res=%s C/count" % (int(t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp))) + print " {(short)(%.2f*OVERSAMPLENR), %s} // v=%s r=%s res=%s C/count" % ((t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp))) else: - print " {%s*OVERSAMPLENR, %s}, // v=%s r=%s res=%s C/count" % (int(t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp))) + print " {(short)(%.2f*OVERSAMPLENR), %s}, // v=%s r=%s res=%s C/count" % ((t.adc(temp)), temp, t.v(t.adc(temp)), t.r(t.adc(temp)),t.res(t.adc(temp))) print "};" def usage():