+ float min = temp[0], max = temp[0];
+
+ for(int i = 0; i < TEMP_SIZE; i++) {
+// Serial.print(temp[i]);
+// Serial.print(" ");
+ if (temp[i] < min && temp[i] > 0) min = temp[i];
+ if (temp[i] > max) max = temp[i];
+ }
+ Serial.println();
+
+ Serial.print("temperature range ");
+ Serial.print(min);
+ Serial.print("-");
+ Serial.println(max);
+
+ // draw right to left so most recent value is on the right
+ for(int x = TEMP_SIZE - 1; x >= 0; x--) {
+ int pos = ( x + temp_pos + 1 ) % TEMP_SIZE;
+ if ( temp[pos] > 0 ) {
+ int y = ( ( temp[pos] - min ) / ( max - min ) ) * ( LCDHEIGHT - 10 );
+ display.drawLine(x, LCDHEIGHT - y, x, LCDHEIGHT, BLACK);
+// display.drawPixel(x,y + 10, BLACK);
+// Serial.print(temp[pos],2);
+// Serial.print(" ");
+ }
+ }
+ Serial.println();
+
+ // refresh LCD