read delay
This commit is contained in:
parent
f71ae18a7b
commit
f6a697fb09
|
@ -28,6 +28,7 @@ void loop() {
|
||||||
int temperature = readTemperature();
|
int temperature = readTemperature();
|
||||||
if (temperature == DHT_ERROR_VALUE) {
|
if (temperature == DHT_ERROR_VALUE) {
|
||||||
Serial.println("Error reading temperature");
|
Serial.println("Error reading temperature");
|
||||||
|
delay(2000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Serial.print("Temperature: ");
|
Serial.print("Temperature: ");
|
||||||
|
@ -40,6 +41,7 @@ void loop() {
|
||||||
turnFanOff();
|
turnFanOff();
|
||||||
turnLedOff();
|
turnLedOff();
|
||||||
}
|
}
|
||||||
|
delay(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define BUZZER_PIN 4
|
#define BUZZER_PIN 4
|
||||||
#define DHT_PIN 2
|
#define DHT_PIN 2
|
||||||
|
|
||||||
#define FAN_ON_TEMP 35
|
#define FAN_ON_TEMP 30
|
||||||
#define FAN_SPEED 120
|
#define FAN_SPEED 120
|
||||||
|
|
||||||
#define DHT_ERROR_VALUE -999
|
#define DHT_ERROR_VALUE -999
|
||||||
|
|
Loading…
Reference in New Issue