From 66be711123e6ed9cdbaebdfd7e758a73b223bd51 Mon Sep 17 00:00:00 2001 From: simonox Date: Fri, 30 Dec 2022 11:37:35 +0100 Subject: [PATCH] formatting --- serial-out/serial-out.ino | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);