improved output aligment and precision

This commit is contained in:
Steffen Vogel 2015-01-06 08:20:52 +01:00
parent 538231edfd
commit fb0996b5db

View File

@ -137,13 +137,13 @@ def main(argv):
print "#define NUMTEMPS %s" % (len(temps)) print "#define NUMTEMPS %s" % (len(temps))
print "const short temptable[NUMTEMPS][2] PROGMEM = {" print "const short temptable[NUMTEMPS][2] PROGMEM = {"
counter = 0
for temp in temps: for temp in temps:
counter = counter +1 print " { (short) (%7.2f * OVERSAMPLENR ), %s\t}%s // v=%.3f\tr=%.3f\tres=%.3f degC/count" % ( t.adc(temp), temp, \
if counter == len(temps): ',' if temp != temps[-1] 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))) t.v( t.adc(temp)), \
else: t.r( 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))) t.res(t.adc(temp)) \
)
print "};" print "};"
def usage(): def usage():