g = new graphics win = g.show[] readings = new array for line = lines["file:///dev/ttyUSB0"] { if length[line] != 15 next temperature = parseInt[substrLen[line,11,4]] * 10^-parseInt[substrLen[line,6,1]] if substrLen[line,1,1] == "1" temperature = -temperature scale = substrLen[line, 4, 2] // println[scale] if scale == "10" temperature = C[temperature] else if scale == "20" temperature = F[temperature] readings.push[temperature] count = 0 p = new polyline for r = readings { p.addPoint[count, -r] count = count + 1 } println[format[F[temperature],1,1]] g = new graphics g.add[p] win.replaceGraphics[g] }