Maker Pro
Maker Pro

working with LCD

bravehamid

Dec 10, 2014
27
Joined
Dec 10, 2014
Messages
27
I have a problem with mega32 & LCD16*2.
i have a easy program for show a text but the text do not show
while (1)
{
lcd_clear();
lcd_gotoxy(5,0);
_lcd_write_data(0x0F); //blink code
lcd_putsf("Hello");
delay_ms(150);

lcd_clear();
lcd_putsf("bahar jigar");
delay_ms(300);

}
}
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,747
Joined
Nov 17, 2011
Messages
13,747
A delay of 150ms or 300ms may be too fast.
Try to get a stable display first, using code like:
Code:
lcd_clear();
lcd_gotoxy(5,0);
_lcd_write_data(0x0F); //blink code
lcd_putsf("Hello");

while (1)
{
/* do nothing */
}
This code should be easy to debug until you have a stable display. Once it works, change the working code back to reflect your original intent (displaying two texts in sequence).
 
Top