Hello i have a project and this is the problem ,
now its running for 1 hour and i just wont to change it to run for 30 min can some one advice me thanks .
#include <dht.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2);
const int ledPin = 2;
int ledState = LOW;
unsigned long previousMillis = 0;
const long interval = 3600000;
dht DHT;
#define DHT11_PIN 7
void setup() {
pinMode(ledPin, OUTPUT);
lcd.begin();
}
void loop()
{
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
if (ledState == LOW)
ledState = HIGH;
else {
ledState = LOW;
}
digitalWrite(ledPin, ledState);
delay(15000);
digitalWrite(ledPin, LOW);
}
int chk = DHT.read11(DHT11_PIN);
lcd.setCursor(0, 0);
lcd.print("Temp: ");
lcd.print(DHT.temperature);
lcd.print((char)223);
lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Humidity: ");
lcd.print(DHT.humidity);
lcd.print("%");
delay(2000);