Lainaus rufus shadowolf <[EMAIL PROTECTED]>:

>
> ( i do it one week ago in french here:
> http://forums.futura-sciences.com/thread233640.html )
>
> to resume if the lcdOut fonction send a char to the lcd display:
> (for all case: char* str = "Hello World")
>
> lcdOut('a');// show me a nice 'a' on the display
>
> lcdOut(str[1]);//show me a nice 'e' on the display
>
> but:
> for(i = 0; i>3; i++)
> {
> lcdOut(str[1]);
> }
> show me 3 strange identical char whitch change when i turn off the pic
> alimentation.
>

<snipped a bit>

I successfully used the following approach: I have one function that  
writes one
character, that is passed with the function call:

void LCDputc(unsigned char c)
{
...
/* Insert code for writing one character to LCD */
...
}

...and then I have another function for writing strings, which works  
exactly like this:

void LCDputs(unsigned char *s)
{
   while(*s) {
     LCDputc(*s++);
   }
}

Then, if you call

LCDputs("Hello World");

it will call the function LCDputc passing a character and then  
increment the pointer to
the string, until it reaches the end of the string.


Hope this helps,
Robert

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to