i cant seem to get temp on line one and humidity on line two. it keeps overwriting itself(word wrap?)
what am i doing wrong ?
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 8, 9, 10, 11 , 12);
#include "DHT.h"
#define DHTPIN 2 // what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
lcd.begin(16, 2);
lcd.setCursor(1,1);
dht.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(f)) {
lcd.print("Failed to read from DHT sensor!");
return;
}
lcd.print("Humidity: ");
lcd.print(h);
lcd.print("Temperature: ");
lcd.print(f);
lcd.print(" *F\t");
}