createTemperatureLookupMarlin.py: Truncate to short after application of OVERSAMPLENR for improved resolution.

This commit is contained in:
David Forrest 2014-01-29 23:23:18 -05:00
parent f5b5dd8038
commit 50f44d9249

View file

@ -143,9 +143,9 @@ def main(argv):
for temp in temps: for temp in temps:
counter = counter +1 counter = counter +1
if counter == len(temps): 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: 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 "};" print "};"
def usage(): def usage():