From fb0996b5db92415afad74d9a39e5e6f89bf831b8 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 6 Jan 2015 08:20:52 +0100 Subject: [PATCH] improved output aligment and precision --- Marlin/scripts/createTemperatureLookupMarlin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/scripts/createTemperatureLookupMarlin.py b/Marlin/scripts/createTemperatureLookupMarlin.py index 372a5b5133..93b5bd7dde 100755 --- a/Marlin/scripts/createTemperatureLookupMarlin.py +++ b/Marlin/scripts/createTemperatureLookupMarlin.py @@ -137,13 +137,13 @@ def main(argv): print "#define NUMTEMPS %s" % (len(temps)) print "const short temptable[NUMTEMPS][2] PROGMEM = {" - counter = 0 for temp in temps: - counter = counter +1 - if counter == len(temps): - 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 " {(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 " { (short) (%7.2f * OVERSAMPLENR ), %s\t}%s // v=%.3f\tr=%.3f\tres=%.3f degC/count" % ( t.adc(temp), temp, \ + ',' if temp != temps[-1] else ' ', \ + t.v( t.adc(temp)), \ + t.r( t.adc(temp)), \ + t.res(t.adc(temp)) \ + ) print "};" def usage():