#include <16F877A>
#include <lcd.c>
#use delay(clock=20000000)
#define en pin_d0;
#define rw pin_d2;
#define rs pin_d1;
#define d4 pin_d4;
#define d5 pin_d5;
#define d6 pin_d6;
#define d7 pin_d7;
void lcd_init()
{
delay_ms(15);
cmd(0x38);
delay_ms(1);
cmd(0x38);
delay_us(100);
cmd(0x38);
cmd(0x28); // Function set (4-bit interface, 2 lines, 5*7Pixels)
cmd(0x28); // Function set (4-bit interface, 2 lines, 5*7Pixels)
cmd(0x0c); // Make cursorinvisible
clear(); // Clear screen
cmd(0x6); // Set entry Mode(auto increment of cursor)
}
void main()
{
lcd_init(); // LCD Display initialization
lcd_cmd(_LCD_CURSOR_OFF); // LCD Command (Cursor Off)
for (;;)
{
printf(1,1,"Hello World"); // Define the first message
Delay_ms(1000);
printf(2,1,"love is love"); // Define the first message
Delay_ms(1000);
}
}