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)
Showing posts with label lcd. Show all posts
Showing posts with label lcd. Show all posts

11/09/2010


●Displaying a Scrolling Script from Right to Left 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

void main()
{

int a=32,x=16;

lcd_init(); //Must be called before any other function

for( ; ;x--,a--){

lcd_gotoxy(x,1);
lcd_putc("Sezgin Secil");
delay_ms(200);
lcd_putc("\f"); //To clear the display
if(a==0){ a=32,x=16; }

}
}


Note: lcd_gotoxy and lcd_putc are the functions that are presented by lcd.c file.

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