From: <ron...@ao...> - 2009-01-04 15:24:42
|
Thanks for the reply. On your reccomendation, I looked at some print examples, but didn't need anything as powerful as printf. I just created a print_LCD (unsigned char* message). function. Here's the working code for anyone at my level... void WriteLCD( unsigned char* message ) { ?unsigned char i; ? ?for( i=0; i<32; i++ ) ?{ ??if( !message[i] ) ???break; ??? ??DATA_OUT(message[i]); ?} }?? Thanks for the lead. Ron -----Original Message----- From: Jacques Pelletier <jpe...@ie...> To: sdc...@li... Sent: Sat, 3 Jan 2009 3:21 pm Subject: Re: [Sdcc-user] LCD print("string") function? On January 3, 2009 02:16:53 pm Ron...@ao... wrote: > This is probably a very basic question, but since I am new to SDCC and the > 8051, I will ask anyway. How can I create a function that will allow me to > write a command like Print_to_LCD("Hello"); without having to previously > store the text to code space or data space and using a pointer. I have a > character print routine running for the I2C LCD already. I just need to > know where to find the ("text") to print after the function call. > Thanks, > Ron > > > ************** > New year...new news. Be the first to know what is making > headlines. (http://www.aol.com/?ncid=emlcntaolcom00000026) If you define your own function putchar to send characters to the LCD, you can use printf to print strings. It should call your putchar routine. JP ------------------------------------------------------------------------------ _______________________________________________ Sdcc-user mailing list Sdc...@li... https://lists.sourceforge.net/lists/listinfo/sdcc-user |