Sunday, June 22, 2008

LCD Scrolling Text



Move your text on your 2x16 HD44780 chipset lcd to left or to right easily.
Here is the code:
#include <16f877.h>
#fuses XT,NOWDT,PUT,NOPROTECT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#include

void sola_kaydir(void)
{
lcd_send_byte
(0, 0×18);
}

void saga_kaydir(void)
{
lcd_send_byte
(0, 0×1E);
}
void main() {
int a,i;

lcd_init
(); //lcd baslat
lcd_putc
(”\f”); //lcd ekranı temizle
//lcd hafızası 40 karaktere kadar alabilir
lcd_putc
(”Kosekoy Eml Elektronik Bolumu”);

for(;;){
for(i = 0; i < 40; i++) //40 karakter için kaydırma
{
saga_kaydir
();
delay_ms
(150); // Kayma hızı
}

for(i = 0; i < 40; i++)
{
sola_kaydir
();
delay_ms
(150);
}
}
}
You can download this projects file from here.

No comments: