Hi,
I have the Arduino Uno. The Keypadshield is a noname from ebay its like the DFRobot LCD Keypad Shield. The i have 2 DHT22.
Everything works fine, until a use a lcd command like lcd.clear(); the i get no information from one of the sensors (-999.,00).
Does someone knows the reason?
Thanks
My first code is:
#include <dht.h>
#include <LiquidCrystal.h>
#include <LCDKeypad.h>
dht DHT;
LCDKeypad lcd;
#define dhtA 6
#define dhtI 5
int localKey = 0;
String keyString = "";
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}
float dewI = 0;
float dewA = 0;
float tempI = 0;
float tempA = 0;
float humI = 0;
float humA = 0;
void setup()
{
Serial.begin(115200); //Verbindung Computer
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("0.01 by Jules");
delay(2500);
}
void loop()
{
DHT.read22(dhtI); //Sensor Innen auslesen
delay(500);
float humI = DHT.humidity;
float tempI = DHT.temperature;
float dewI = (dewPointFast(DHT.temperature, DHT.humidity));
DHT.read22(dhtA); //Sensor Aussen auslesen
delay(500);
float humA = DHT.humidity;
float tempA = DHT.temperature;
float dewA = (dewPointFast(DHT.temperature, DHT.humidity));
Serial.println ("Innensensor:");
Serial.print ("humI: ");
Serial.println (humI);
Serial.print ("tempI: ");
Serial.println (tempI);
Serial.print ("dewI: ");
Serial.println (dewI);
Serial.println ("");
Serial.println ("Aussensensor:");
Serial.print ("humA: ");
Serial.println (humA);
Serial.print ("tempA: ");
Serial.println (tempA);
Serial.print ("dewA: ");
Serial.println (dewA);
Serial.println ("____________________");
}