Hi,
Why when I include library LiquidCrystal_I2C to program ESP8266 is refused?
I am using IDE Arduino to write the program.
#include <jm_LiquidCrystal_I2C.h>
#include <DHT.h>
#include <DHT_U.h>
#include <Wire.h>
//Constants
#define DHT22_PIN 2 // DHT 22 (AM2302) - pin used for DHT22
#define DHTTYPE DHT22
DHT dht(DHT22_PIN,DHTTYPE);
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // set the LCD address to 0x27 after finding it from serial monitor (see comment above) for a 16 chars and 2 line display
int vetorled={10,11};
//int DHTValor = 0;
//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
float DHTValor = 0;
void setup()
{
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
Serial.begin(9600);
dht.begin();
lcd.begin(16,2); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.setBacklight(HIGH);
}
void loop()
{
delay(2000);
//Read data and store it to variables hum and temp
hum = dht.readHumidity();
temp= dht.readTemperature();
//Print temp and humidity values to LCD
Serial.print("Humidity:");
Serial.print(hum);
Serial.print("%,Temp:");
Serial.print(temp);
Serial.println("Celsius");
delay(10000);
lcd.setCursor(0,0);
lcd.print("Humidity: ");
lcd.print(hum);
lcd.print("%");
lcd.setCursor(0,1);
lcd.print("Temp: ");
lcd.print(temp);
lcd.println("Celsius");
delay(2000); //Delay 2 sec between temperature/humidity check.
if(hum < 40){
digitalWrite(10,HIGH);
delay(500);
digitalWrite(10,LOW);
delay(500);
digitalWrite(10,HIGH);
delay(500);
digitalWrite(10,LOW);
delay(500);
digitalWrite(10,HIGH);
delay(500);
digitalWrite(10,LOW);
delay(500);
digitalWrite(10,HIGH);
delay(100);
digitalWrite(11,LOW);
delay(100);
}
if(hum >= 40){
digitalWrite(11,HIGH);
delay(500);
digitalWrite(11,LOW);
delay(500);
digitalWrite(11,HIGH);
delay(500);
digitalWrite(11,LOW);
delay(500);
digitalWrite(11,HIGH);
delay(500);
digitalWrite(11,LOW);;
delay(500);
digitalWrite(11,HIGH);
delay(100);
digitalWrite(10,LOW);
delay(100);
}
}