Hi all
I've been trying to use a 20x4 HD44780 LCD display as part of my Arduino project.
The HD44780 command set includes commands for moving the cursor left and right, however when using this I have noted some strange behavior.
On each line the cursor moves as expected, however when it gets to the end of the line it does not go to the next line as expected but follows the sequence Line1 -> Line3 -> Line2 -> Line4.
Anyone come across this issue before?
Thanks in anticipation.
Code snippet below...
#include <SoftwareSerial.h>
#define txPin 12
SoftwareSerial LCD = SoftwareSerial(0, txPin);
void setup()
{
LCD.begin(9600);
// Clear display
LCD.write(0xFE);
LCD.write(0x01);
delay(3);
// This works as expected filling the screen with 'X's. Line sequence 1-2-3-4
for (int i = 1;i<=80;i++)
{
LCD.write("X");
delay(100);
}
// This doesn't work as expected. Line sequence 1-3-2-4.
for(int i = 1;i <=80;i++)
{
LCD.write(0xFE); // Command to follow.
LCD.write(0x14); // Move cursor to right.
delay(100);
}
}
void loop()
{
}