Hy there.
Let me explain what i intend to do: using 2 pins , if the temperature is over 40 degrees then set digitalpin3(LOW) --> 0V.(is an example)
If humidity is over 95 % , then set digitalpin3(low).
But, if the temperature is over 40 , only one pin is LOW(OV) , the other one is (HIGH) amd the other way for exceeding 95% for humidity .
At first the pins must be on HIGH.(both) initially .
I have the program but my modifications havent led me anywhere.
I want to modify this program because it is tested and works just fine .
Any ideas?Thx!
Let me explain what i intend to do: using 2 pins , if the temperature is over 40 degrees then set digitalpin3(LOW) --> 0V.(is an example)
If humidity is over 95 % , then set digitalpin3(low).
But, if the temperature is over 40 , only one pin is LOW(OV) , the other one is (HIGH) amd the other way for exceeding 95% for humidity .
At first the pins must be on HIGH.(both) initially .
I have the program but my modifications havent led me anywhere.
I want to modify this program because it is tested and works just fine .
Any ideas?Thx!
Code:
Code:
#include "DHT.h"
#define DHTPIN 9
#define DHTTYPE DHT22
DHT dht22(DHTPIN, DHTTYPE);
#include "Wire.h"
#include "LiquidCrystal_I2C.h"
LiquidCrystal_I2C lcd(0x27,16,2);
void setup()
{
Serial.begin(9600);
Serial.println("DHT22 serial");
dht22.begin();
lcd.init();
lcd.backlight();
lcd.print(" OK ");
lcd.setCursor (0, 1);
lcd.print(F("Reading data"));
delay(5550);
}
void loop()
{
lcd.setCursor(0,0);
float t = dht22.readTemperature() ;
float h = dht22.readHumidity() ;
Serial.print("Temperature is: ");
Serial.print(t);
Serial.print(" C\t");
Serial.print("Humidity is: ");
Serial.print(h);
Serial.print(" %");
lcd.setCursor(0, 0);
lcd.print("Temp. : ");
lcd.setCursor(9, 0);
lcd.print(t);
lcd.setCursor(15, 0);
lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Umidit.: ");
lcd.setCursor(9, 1);
lcd.print(h);
lcd.setCursor(15, 1);
lcd.print("%");
}