From f6a697fb099759516a5cdf29491c8bd07974f175 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Fri, 28 Jun 2024 12:17:49 +0700 Subject: [PATCH] read delay --- src/main.cpp | 2 ++ src/main.hpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9bc3414..435405f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,7 @@ void loop() { int temperature = readTemperature(); if (temperature == DHT_ERROR_VALUE) { Serial.println("Error reading temperature"); + delay(2000); return; } Serial.print("Temperature: "); @@ -40,6 +41,7 @@ void loop() { turnFanOff(); turnLedOff(); } + delay(2000); } /** diff --git a/src/main.hpp b/src/main.hpp index 8f07dd4..7b0608e 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -14,7 +14,7 @@ #define BUZZER_PIN 4 #define DHT_PIN 2 -#define FAN_ON_TEMP 35 +#define FAN_ON_TEMP 30 #define FAN_SPEED 120 #define DHT_ERROR_VALUE -999