Author Topic: Getting rprintf to work with an LCD  (Read 1109 times)

0 Members and 1 Guest are viewing this topic.

Offline KirkTopic starter

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 2
Getting rprintf to work with an LCD
« 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

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,166
  • Helpful? 111
Re: Getting rprintf to work with an LCD
« Reply #1 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!

Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline KirkTopic starter

  • Jr. Member
  • **
  • Posts: 44
  • Helpful? 2
Re: Getting rprintf to work with an LCD
« Reply #2 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


 


Get Your Ad Here

data_list