View previous topic :: View next topic |
Author |
Message |
sahu77
Joined: 08 Sep 2011 Posts: 202
|
scroll Text on 16*2 lcd |
Posted: Fri Jan 27, 2012 10:16 am |
|
|
How can I use scroll Text on 16*2 lcd. I use flex_lcd.c ? _________________ sahu |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Jan 27, 2012 11:32 am |
|
|
Hi,
Here is a code snippet that illustrates scrolling on an LCD:
Code: |
char message[15] = "Hello World! ";
int8 ctr;
for (ctr=0;ctr<14;ctr++) {
lcd_gotoxy(1,2);
printf(lcd_putc,"%s",message+ctr);
delay_ms(100);
}
|
John |
|
|
sahu77
Joined: 08 Sep 2011 Posts: 202
|
|
Posted: Fri Jan 27, 2012 12:14 pm |
|
|
ezflyr wrote: | Hi,
Here is a code snippet that illustrates scrolling on an LCD:
Code: |
char message[15] = "Hello World! ";
int8 ctr;
for (ctr=0;ctr<14;ctr++) {
lcd_gotoxy(1,2);
printf(lcd_putc,"%s",message+ctr);
delay_ms(100);
}
|
John |
its work as
Code: | Hello World!
ello World!
llo World!
lo World!
o World!
World!
World!
orld!
orld!
rld!
ld!
d!
!
|
i want as
Code: |
!
d!
ld!
rld!
orld!
Hello World!
|
hope understand what i want to say u ?
sorry for my bad English . _________________ sahu |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Fri Jan 27, 2012 1:57 pm |
|
|
Well you didn't specify which direction !!
We had no example to see what you really wnated.
Simply redo the counter and starting position of the message.
Use graph paper to layout what you want,decide on whether the counter should count up or down, and where 'start' location will be.
10 lines of code..... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
sahu77
Joined: 08 Sep 2011 Posts: 202
|
|
Posted: Sat Jan 28, 2012 10:37 am |
|
|
Thank you very much PCM!! It works perfect! but has 1 problem. as i use
Code: | lcd_gotoxy(1,1);
printf(lcd_putc,"%s",message_1);
lcd_scroll_right();
delay_ms(500);
lcd_gotoxy(1,2);
printf ( lcd_putc, "message_2" );
delay_ms(500); |
my aim is only message_1 scroll_right .as i use message_1 & message_2 both are scroll_right . _________________ sahu |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Sat Jan 28, 2012 11:05 am |
|
|
So, you have to use the software approach as ezflyr has already shown, just with the direction reversed (temtronic's post). The hardware scrolling only works for the whole screen.
Best Wishes |
|
|
|