print big values

This commit is contained in:
Cedric Girard 2020-05-11 18:08:01 +02:00
parent 367b55a8de
commit e257e85ff9
Signed by: X-dark
GPG key ID: E7D0E125DB9519E4

View file

@ -97,56 +97,87 @@ void readMetrics() {
void printMetrics() { void printMetrics() {
//Clear screen //Clear buffer
u8g2log.print("\f\n"); u8g2.clearBuffer();
//Print a different metrics each time //Print a different metrics each time
switch (last_printed) { switch (last_printed) {
case 0: case 0:
u8g2log.print("Temp: "); u8g2.setCursor(0, 15);
u8g2log.print(temp); u8g2.setFont(u8g2_font_fur14_tf);
u8g2log.print("°C\n"); u8g2.print("Temperature");
u8g2.setCursor(0, 70);
u8g2.setFont(u8g2_font_fur30_tf);
u8g2.print(temp,1);
u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print(" °C");
last_printed++; last_printed++;
break; break;
case 1: case 1:
u8g2log.print("Hum: "); u8g2.setCursor(0, 15);
u8g2log.print(hum); u8g2.setFont(u8g2_font_fur14_tf);
u8g2log.print("% RH\n"); u8g2.print("Humidity");
u8g2.setCursor(0, 70);
u8g2.setFont(u8g2_font_fur30_tf);
u8g2.print(hum,1);
u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print(" % RH");
last_printed++; last_printed++;
break; break;
case 2: case 2:
u8g2log.print("Pres: "); u8g2.setCursor(0, 15);
u8g2log.print(pres); u8g2.setFont(u8g2_font_fur14_tf);
u8g2log.print("hPa\n"); u8g2.print("Pressure");
u8g2.setCursor(0, 70);
u8g2.setFont(u8g2_font_fur30_tf);
u8g2.print(pres,0);
u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print(" hPa");
last_printed++; last_printed++;
break; break;
case 3: case 3:
u8g2.setCursor(0, 15);
u8g2.setFont(u8g2_font_fur14_tf);
u8g2.print("Total VOC");
u8g2log.print("TVOC "); u8g2.setCursor(0, 70);
u8g2log.print(sgp.TVOC); u8g2.setFont(u8g2_font_fur30_tf);
u8g2log.print(" ppb\n"); u8g2.print(sgp.TVOC);
u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print(" ppb");
last_printed++; last_printed++;
break; break;
case 4: case 4:
u8g2log.print("eCO2 "); u8g2.setCursor(0, 15);
u8g2log.print(sgp.eCO2); u8g2.setFont(u8g2_font_fur14_tf);
u8g2log.print(" ppm\n"); u8g2.print("Equiv CO2");
u8g2.setCursor(0, 70);
u8g2.setFont(u8g2_font_fur30_tf);
u8g2.print(sgp.eCO2);
u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print(" ppm");
last_printed = 0; last_printed = 0;
break; break;
default: default:
u8g2log.print("invalid last_printed value\n"); u8g2.setFont(u8g2_font_fur11_tf);
u8g2.print("invalid last_printed value");
last_printed = 0; last_printed = 0;
break; break;
} }
u8g2.sendBuffer();
} }
@ -156,11 +187,6 @@ void readBaseline() {
u8g2log.print("Failed to get baseline readings\n"); u8g2log.print("Failed to get baseline readings\n");
return; return;
} }
u8g2log.print("Baseline values: eCO2: 0x");
u8g2log.print(eCO2_base, HEX);
u8g2log.print(" & TVOC: 0x");
u8g2log.print(TVOC_base, HEX);
u8g2log.print("\n");
//Init Non Volatile Storage //Init Non Volatile Storage
// Namespace name is limited to 15 chars. // Namespace name is limited to 15 chars.