Calculate temperature and humidity for 15 minutes

I'm using this code

// Import required libraries
#include "WiFi.h"
#include <Adafruit_Sensor.h>
#include <DHT.h>

#define DHTPIN 27 // Digital pin connected to the DHT sensor

// Uncomment the type of sensor in use:
#define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

String readDHTTemperature() {
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
//float t = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return "--";
}
else {
Serial.println(t);
return String(t);
}
}

String readDHTHumidity() {
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
if (isnan(h)) {
Serial.println("Failed to read from DHT sensor!");
return "--";
}
else {
Serial.println(h);
return String(h);
}
}

void setup(){
// Serial port for debugging purposes
Serial.begin(115200);

dht.begin();

readDHTHumidity();
readDHTTemperature();

}

void loop(){

}

to compute the humidity and temperature, now I'm asking how can calculate temperature and humidity for 15 minutes ?

Use millis() for the timing so as not to block the operation of the sketch

See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE

Probably better to post your code here, not on a site asking for cookie permissions which many people will not do.

Meantime, what does this actually mean?-

updated!

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.