Was für Bibliothek benutzt Du?
im meinem Fall
[code]
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C LCD(0x3F, 16, 2);
#include "DHT.h"
#define DHTPIN 13
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#include <IRremote.h>
IRrecv irrecv(2); // Ausgangs-Pin von TSOP4838 (IR)
decode_results results;
unsigned long previousMillis = 0; // speichert den Zeitpunkt an dem zuletzt geschalten wurde 0;
const long intervall = 5000;
void setup() {
Serial.begin(9600);
LCD.init();
LCD.backlight();
dht.begin();
irrecv.enableIRIn();
}
void loop() {
//IR /////
unsigned int IRwert = results.value;
if (irrecv.decode(&results)) {
irrecv.decode(&results);
Serial.println(IRwert,HEX);
irrecv.resume();
}
if (IRwert == 14535) LCD.noBacklight();
if (IRwert == 57375) LCD.backlight();
LCD.setCursor(0, 0);
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= intervall) // Falls mehr als 2000 ms vergangen sind
{
previousMillis = currentMillis; // Zeitpunkt der letzten Schaltung wird festgehalten
float h = dht.readHumidity();
float t = dht.readTemperature();
LCD.print (F("Temp. "));
LCD.print(t , 1 );
LCD.print((char)223);// /223=° Grad Zeichen
LCD.print(F("C"));
LCD.setCursor(0, 1);
LCD.print (F("rh: "));
LCD.print((int)h);
LCD.print(F(".0 %"));
}
}
[/code]
gibst keine nan
mit anderen schon öfters.
Ok ist für Uno, mega nano