Fix humidity variable name

This commit is contained in:
Dano van den Bosch
2024-02-10 17:40:02 +01:00
parent 7976a00f3d
commit a2eb31b07c

View File

@@ -19,7 +19,7 @@ Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire,
#define DHTPIN 42 // Digital pin connected to the DHT sensor
DHT dht(DHTPIN, DHTTYPE);
float humiditities;
float humiditi;
float themp;
int debug = 0;
@@ -48,7 +48,7 @@ void loop() {
thempReading();
display.setCursor(0, 0);
display.println((String) "Temp: " + int(themp) + "C" + '\n' + "Humi: " + int(humiditities) + "%");
display.println((String) "Temp: " + int(themp) + "C" + '\n' + "Humi: " + int(humiditi) + "%");
display.display();
}
@@ -58,12 +58,12 @@ void thempReading(){
display.clearDisplay();
humiditities = dht.readHumidity();
humiditi = dht.readHumidity();
// Read temperature as Celsius (the default)
themp = dht.readTemperature();
if (debug == 1){
Serial.println((String)humiditities + "% " + themp + "C");
Serial.println((String)humiditi + "% " + themp + "C");
}
}