I have written small piece of code for displaying data in 2x16 character LCD.
char str2[] = "Hello Welcome";
char *ptr2=str2;
initializeLCD();
sendLCDCommand(CLEAR_DISPLAY);
while(*ptr2) {
displayInRow1(ptr2++);
CL_delayMS(300);
}
In this code, the display displays "Hello Welcomeeeeeeeeeeeeeeeeeeeee" I thought while(*ptr2) will terminate after printing last letter "e" in the string. If I comment the line containing while(*ptr2), the data is displayed correctly. I am not sure what is wrong with this code above. I am using Atmel Studio with Atmega328 controller. displayInRow1() function is tested and no issue with that.