diff --git a/serial-out/serial-out.ino b/serial-out/serial-out.ino index c906036..01bb28e 100644 --- a/serial-out/serial-out.ino +++ b/serial-out/serial-out.ino @@ -4,7 +4,7 @@ DHTesp dht; void setup() { - Serial.begin(115200); + Serial.begin(115200); // use this baud rate in serial monitor to see stuff dht.setup(D0, DHTesp::DHT11); // Connect DHT sensor to D0 } @@ -13,18 +13,16 @@ void loop() { float humi = dht.getHumidity(); // read temperature in Celsius float tempC = dht.getTemperature(); - - // read soil int soil = analogRead(AOUT_PIN); // read the analog value from sensor - // check whether the reading is successful or not - if ( isnan(tempC) || isnan(humi)) { + if (isnan(tempC) || isnan(humi)) { Serial.println("Failed to read from DHT sensor!"); } if (isnan(soil)) { Serial.println("Failed to read from soil sensor!"); } else { + Serial.print("Humidity: "); Serial.print(humi); Serial.print("%"); @@ -34,7 +32,9 @@ void loop() { Serial.print("Temperature: "); Serial.print(tempC); Serial.print(" C "); + Serial.print(" | "); + Serial.print("Moisture value: "); Serial.println(soil);