Fix humidity variable name
This commit is contained in:
@@ -19,7 +19,7 @@ Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire,
|
|||||||
#define DHTPIN 42 // Digital pin connected to the DHT sensor
|
#define DHTPIN 42 // Digital pin connected to the DHT sensor
|
||||||
DHT dht(DHTPIN, DHTTYPE);
|
DHT dht(DHTPIN, DHTTYPE);
|
||||||
|
|
||||||
float humiditities;
|
float humiditi;
|
||||||
float themp;
|
float themp;
|
||||||
|
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
@@ -48,7 +48,7 @@ void loop() {
|
|||||||
thempReading();
|
thempReading();
|
||||||
|
|
||||||
display.setCursor(0, 0);
|
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();
|
display.display();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -58,12 +58,12 @@ void thempReading(){
|
|||||||
display.clearDisplay();
|
display.clearDisplay();
|
||||||
|
|
||||||
|
|
||||||
humiditities = dht.readHumidity();
|
humiditi = dht.readHumidity();
|
||||||
// Read temperature as Celsius (the default)
|
// Read temperature as Celsius (the default)
|
||||||
themp = dht.readTemperature();
|
themp = dht.readTemperature();
|
||||||
|
|
||||||
if (debug == 1){
|
if (debug == 1){
|
||||||
Serial.println((String)humiditities + "% " + themp + "C");
|
Serial.println((String)humiditi + "% " + themp + "C");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user