CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

scroll Text on 16*2 lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sahu77



Joined: 08 Sep 2011
Posts: 202

View user's profile Send private message

scroll Text on 16*2 lcd
PostPosted: Fri Jan 27, 2012 10:16 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 27, 2012 11:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 27, 2012 12:14 pm     Reply with quote

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: 9177
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 27, 2012 1:57 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 27, 2012 2:06 pm     Reply with quote

The method shown above is software side scrolling.
The thread below has code to use the LCD's hardware to do side scrolling.
http://www.ccsinfo.com/forum/viewtopic.php?t=42792
sahu77



Joined: 08 Sep 2011
Posts: 202

View user's profile Send private message

PostPosted: Sat Jan 28, 2012 10:37 am     Reply with quote

PCM programmer wrote:
The method shown above is software side scrolling.
The thread below has code to use the LCD's hardware to do side scrolling.
http://www.ccsinfo.com/forum/viewtopic.php?t=42792


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: 19382

View user's profile Send private message

PostPosted: Sat Jan 28, 2012 11:05 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group