My previous post was not very clear so I am starting a new post...Please don't merge them.
When my humidity sensor is connected to my 2 * 16 LCD, the LCD starts showing weird characters...I am using a DHT11 Temperature and Humidity Sensor...
I wanted to print the temperature in the first line and the humidity in the second line. For a split second sometimes it becomes proper but then returns back to its weird characters..
Here is my code:-
#include<LiquidCrystal.h>
#include <DHT.h>
const int dhtPin = 8;
#define DHTTYPE DHT11
DHT dht ( dhtPin, DHTTYPE );
LiquidCrystal lcd ( 12, 11, 5, 4, 3, 2 );
int Contrast = 75;
void setup() {
// put your setup code here, to run once:
Serial.begin ( 9600 );
lcd.begin ( 16, 2 );
analogWrite ( 6, Contrast );
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float c = dht.readTemperature();
float h = dht.readHumidity();
lcd.home();
lcd.print ( "Temperature: " );
lcd.print ( c );
lcd.setCursor ( 0, 1 );
lcd.print ( "Humidity: " );
lcd.print ( h );
lcd.print ( "%" );
delay ( 1000 );
}
The image of the weird characters is attached to this post....
Can someone please help me out? Thank you!!!