not knowing much about the C compiler being used, how about: void my_lcd_putc(byte c) { lcd_send_byte(rs,c); } int d; void main() { printf(my_lcd_putc, "Here is an integer: %d", d) } or some such.... Bob Ammerman RAm Systems ----- Original Message ----- From: "Dale Botkin" To: Sent: Tuesday, March 19, 2002 7:35 AM Subject: Re: [PIC]: displaying a value on LCD > On Tue, 19 Mar 2002, MATTHEWS, DEAN (D.) wrote: > > > Dale, > > > > Im extremely confused, again! I am sending bytes of data into the Lcd > > as nibbles(using 4 data pins and two control pins) and not serially > > using the following function: > > > > void lcd_send_byte(byte rs, byte n) > > { > > port_c=rs; > > delay_ms(500); > > lcd_send_nibble(n>>4); > > lcd_send_nibble(n&0xf); > > } > > Hmmm. Are you using the CCS LCD driver file, lcd.c? It looks like you > might be, since that file includes lcd_send_nibble(). If so, it's also > got an lcd_putc() function you can use to save yourself some tmie and > effort. I'm not sure what the rs parameter of the function above is > doing, but lcd_send_byte() needs two parameters. I think sending printf() > output to a function will only work with a function that takes a single > parameter -- printf() will call it once for each character in the > resulting output. Doing this: > > printf(lcd_putc,"value in memory is %02x",NUMBER); > > should get you there, assuming you have a function lcd_putc() that takes a > character as a single parameter and spits it out to the LCD. > Alternatively, if the port_c=rs bit is impoprtant you could maybe do > something like this: > > ***WARNING*** untested code ahead! > > char x = 0; > char buffer[25]; > sprintf(buffer,"value in memory is %02x",NUMBER); > // puts output string in buffer > while(buffer[x] lcd_send_byte(rs, buffer[x++]); > // calls lcd_send_byte for each character in buffer > > Dale > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics