Society of Robots - Robot Forum

Software => Software => Topic started by: Kirk on July 20, 2009, 10:55:04 PM

Title: Getting rprintf to work with an LCD
Post by: Kirk on July 20, 2009, 10:55:04 PM
OK, so I know and love avrlib rprintf command (and the vt100 library).  I have used it in several projects over a UART.

Now I need to use a parallel LCD.

I got the LCD working using the avrlib LCD library, but not using rprintf.  How do I direct the rprintf data to the LCD?  What function do I put in rpintfinit?
Does anyone have sample code?
I doubt that \n and \t will work but that is OK.

Thanks
Kirk
Title: Re: Getting rprintf to work with an LCD
Post by: Webbot on July 21, 2009, 12:30:18 PM
I think you need to write a function such as:

void LCD_printchar(char c){
  Then call the appropriate AVRlib methods to output the character
}

Then call

rprintfInit(&LCD_printchar);

to tell rprintf to call this routine for each byte being output

I dont have a parallel LCD - so thats the limit of my help!

Title: Re: Getting rprintf to work with an LCD
Post by: Kirk on July 21, 2009, 05:02:37 PM
Thanks!
When using AVRlib lcd.c and AVRlib rprintf.c the following links rprintf to the LCD

   rprintfInit(&lcdDataWrite);  // configure rprintf to use LCD for output

   rprintfInit(lcdDataWrite);  // this also works. I guess that I do not understand how this really works.

Alas \n does not work.
But the other nice formatting tools like rprintfNum work!

Thanks again for the help.
Kirk