Browse Source

show units

ir
Hendrik Langer 5 years ago
parent
commit
aef4f48502
  1. 9
      src/main.cpp

9
src/main.cpp

@ -239,8 +239,9 @@ void displayValues() {
display.printf("max: %.1f", sensor_readings.temperature_max); display.printf("max: %.1f", sensor_readings.temperature_max);
display.setFont(&FreeSansBold9pt7b); display.setFont(&FreeSansBold9pt7b);
display.setCursor(5,y_offset+40); display.setCursor(5,y_offset+40);
display.printf("%.1f*C", sensor_readings.temperature); display.printf("%.1f", sensor_readings.temperature);
display.setFont(NULL); display.setFont(NULL);
display.print(" \xf7\x43");
display.setCursor(5,y_offset+45); display.setCursor(5,y_offset+45);
display.printf("min: %.1f", sensor_readings.temperature_min); display.printf("min: %.1f", sensor_readings.temperature_min);
@ -253,6 +254,7 @@ void displayValues() {
display.setCursor(70,y_offset+40); display.setCursor(70,y_offset+40);
display.printf("%.1f", sensor_readings.humidity); display.printf("%.1f", sensor_readings.humidity);
display.setFont(NULL); display.setFont(NULL);
display.print(" \%");
display.setCursor(70,y_offset+45); display.setCursor(70,y_offset+45);
if (sensor_readings.humidity < 30) { if (sensor_readings.humidity < 30) {
display.print("low"); display.print("low");
@ -271,8 +273,9 @@ void displayValues() {
display.setFont(&FreeSansBold9pt7b); display.setFont(&FreeSansBold9pt7b);
display.setCursor(135,y_offset+40); display.setCursor(135,y_offset+40);
display.printf("%.1f", sensor_readings.pressure / 100.0F); display.printf("%.1f", sensor_readings.pressure / 100.0F);
float pressure_diff = history_pressure.getElement(0) - history_pressure.getFirst();
display.setFont(NULL); display.setFont(NULL);
//display.print(" hPa");
float pressure_diff = history_pressure.getElement(0) - history_pressure.getFirst();
display.setCursor(135,y_offset+45); display.setCursor(135,y_offset+45);
if (isnan(pressure_diff) || history_pressure.getCount() < history_pressure.getSize()) { if (isnan(pressure_diff) || history_pressure.getCount() < history_pressure.getSize()) {
} else if (pressure_diff > -20 && pressure_diff < -1.1) { } else if (pressure_diff > -20 && pressure_diff < -1.1) {
@ -297,7 +300,7 @@ void displayValues() {
display.setCursor(200,y_offset+15); display.setCursor(200,y_offset+15);
display.println("VOC:"); display.println("VOC:");
display.setCursor(200,y_offset+25); display.setCursor(200,y_offset+25);
display.printf("%.1f", sensor_readings.voc / 1000.0F); display.printf("%.1f k\xe9", sensor_readings.voc / 1000.0F);
// PM // PM
float pm10, pm25; float pm10, pm25;
if (sds_active) { if (sds_active) {

Loading…
Cancel
Save