Using a 20 * 4 LCD Display connected to a Mega
Text displays to line 2, line 1, line 4 then line 3 instead of 1,2,3,4 (Using lcd.setCursor(0,0) to lcd.setCursor(0,3)
Text characters are all correct order etc, just rows wrong,Tried 2 Displays
(Occassionally a reset will put the rows in the correct order)
OK - according to page 10 of the datasheet this device has the same (unusual) addressing scheme as most standard LCDs so that's not the problem.
I see that you are sending the information to the LCD over and over again very quickly, since there are no delays in your program. The LCD does not have to be refreshed so that if the information does not change it does not have to be resent. All of your code should be in setup() and loop() should be blank.
I think the rows and columns in the code are incorrect.
lcd.setCursor(2,0); // maybe you want this to be (0,0)
lcd.write("The Geeze Rules 1");
lcd.setCursor(1,1); // maybe you want this to be (1,0)
lcd.write("The Geeze Rules 2");
lcd.setCursor(2,2); // maybe you want this to be (2,0)
lcd.write("The Geeze Rules 3");
lcd.setCursor(1,3); // maybe you want this to be (3,0)
lcd.write("The Geeze Rules 4");
The one line is overflowing by one character that starts at column 3 and goes 17 characters
I think the rows and columns in the code are incorrect.
There's no way to tell what he intended since he did not comment his statements.
example:
lcd.setCursor(2,0); // start text at column ... of row ...
lcd.write("The Geeze Rules 1");
lcd.setCursor(1,1); // start text at column ... of row ...
lcd.write("The Geeze Rules 2");
lcd.setCursor(2,2); // start text at column ... of row ...
lcd.write("The Geeze Rules 3");
lcd.setCursor(1,3); // start text at column ... of row ...
lcd.write("The Geeze Rules 4");
The one line is overflowing by one character that starts at column 3 and goes 17 characters
This Code works fine on a 20 * 4 LCD Display (Not the OLED Display) Contrast not so good. Even after pressing reset a number of times and in the order laid out in the sketch
(Image attached)
Loading the same sketch on the OLED is as these images (Rows all incorrect)
After pressing reset for a third time text becomes as garbage
On the LCD, do you have an adjustable resistor for the contrast? Also called a trimpot / potentiometer...
Pressing the reset button should start your sketch over on the Arduino.
The serial back pack I'm using has a reset circuit that resets the display at the same time my arduino resets.
Maybe one of the experts here knows if a display reset is required every time the arduino is reset. You could accomplish the same thing by unplugging the power supply - assuming the display and arduino are using the same power. You probably know all this already...
Try 'adjusting' it a little more and see what happens:
From reply #8:
"I see that you are sending the information to the LCD over and over again very quickly, since there are no delays in your program. The LCD does not have to be refreshed so that if the information does not change it does not have to be resent. All of your code should be in setup() and loop() should be blank."
On the LCD, do you have an adjustable resistor for the contrast? Also called a trimpot / potentiometer...
His contrast is fine, you can see that from the photos.
Pressing the reset button should start your sketch over on the Arduino.
The serial back pack I'm using has a reset circuit that resets the display at the same time my arduino resets.
This was a problem with some ancient versions of the LiquidCrystal library. All of the recent versions (several years worth) take care of resetting the LCD controller with software when the Arduino restarts the library.
Maybe one of the experts here knows if a display reset is required every time the arduino is reset. You could accomplish the same thing by unplugging the power supply - assuming the display and arduino are using the same power. You probably know all this already...
The display should be reset since you do not know where it was (in it's internal program) when it stopped getting instructions from the Arduino. Unplugging the power supply would accomplish this as you stated.
thegeeze:
Thanks for your all your input.Now Solved!
But you really haven't responded to our input, or to mine at least, and I don't think that all of your problems are really solved. You still haven't fixed the improper structure of your program so you are probably going to run into other problems as you try to do more with the display.