Hy there. I have a problem with my project.
I want to show the temp/humidity from a dht22 sensor to a lcd 16x2 via i2c communication.
As you can see : from direct view i don't see anything,just some squares; but from different angle -all is clear.
What i must add in the program in order to see it clear from any angle .
I have to add a new line to clear the screen?
------------------------------------------CODE BELOW------------------------------------------------
------------------------------------------END OF CODE----------------------------------------------
I want to show the temp/humidity from a dht22 sensor to a lcd 16x2 via i2c communication.
As you can see : from direct view i don't see anything,just some squares; but from different angle -all is clear.
What i must add in the program in order to see it clear from any angle .
I have to add a new line to clear the screen?
------------------------------------------CODE BELOW------------------------------------------------
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("%");
}
Attachments
-
642.9 KB Views: 17
-
499.2 KB Views: 12
-
167.6 KB Views: 14