Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine. (Nikola Tesla)

23/08/2010


●Displaying Constant Scripts on 2x16 LCD

Here is the program written by using CCS C.



#include <16f628.h>
#fuses NOPROTECT, NOWDT, NOLVP, NOMCLR, INTRC_IO
#use delay(clock=4M)
#include //It is essential for using LCD in our program

void main(){

lcd_init(); //Must be called before any other function
while(1){
lcd_gotoxy(1,2); //To set write position on LCD
lcd_putc("Sezgin Secil"); //Displaying script on the next position of the LCD
}
}



Note: For using LCD in our designs, we should use lcd.c file. It is used for both Port B and D. So, if we want to use it for Port B, we need a modification in the lcd.c file:
Find LCD.C file in drivers, open it, find the line that consists of "//define use_portb_lcd TRUE" and change that as "define use_portb_lcd TRUE". All you need to do is removing the the double slash at the beginning of the command.



ShareThis