This is probably a stupid question as i found nothing on the internet about it. I have this basic 16x2 lcd which works great, i have the stationary text on upper line under set up and variables on line 2 under loop. I tried to add alot of spaces after my stationary text and add more text to test it and came into the conclusion that lcd will be able to show all the needed information. However i have since edited that back to normal short text with no spaces, but lcd still behaves as the spaces are still there, showing a blank screen for about 3 seconds after my text and variables have rolled over before starting over. The code is attached as a file. Thank you.
The code is below:
// include the library code:
#include <LiquidCrystal.h>
#include "DHT.h"
int valovoimakkuus;
// set the DHT Pin
#define DHTPIN 7
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
dht.begin();
// Print a message to the LCD.
lcd.print("Temp: Humidity: LDR:");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
lcd.scrollDisplayLeft();
delay(200);
// read humidity
valovoimakkuus = analogRead(A0);
float h = dht.readHumidity();
//read temperature in Fahrenheit
float c = dht.readTemperature();
if (isnan(h) || isnan(c)) {
lcd.print("ERROR");
return;
}
lcd.setCursor(0,1);
lcd.print(c);
lcd.setCursor(7,1);
lcd.print(h);
lcd.setCursor(16,1);
lcd.print(valovoimakkuus);
}