What I want to do is to read the sensor values into temporary variables (the floats) and only give these values to my struct if they arent NaN. If they are NaN I want the loop run again, until they are not, then give the values to my struct.
void loop() {
float humidity = dht.readHumidity();
float temperature = bmp280.readTemperature();
humidity = dht.readHumidity();
temperature = bmp280.readTemperature();
if(isnan(humidity) || isnan(temperature)){
return; // <- does this jumps back to the beginning of the loop() ?
}
// the variables of my struct
weatherDataPackage.temperature = temperature;
weatherDataPackage.humidity = humidity;
// and here come a commands that sends the struct via radio and puts the esp8266 intro 1 min sleep...
}