| Author |
Message |
Picstudent
Joined: 05 May 2004 Posts: 536 Helped: 13 Location: India
|
14 Feb 2005 5:12 hi-tech printf |
|
|
|
|
Hai
I have to print a float number like 32.56565 into an lcd,
Or a long number like 3256565 into lcd.
1. How can I use the 'printf ' to print this into lcd?
Hi tech manual says about writing putchar function.Where to write and how to integrate it to printf?
2.Which is the best way to do bcd conversion for this number in C (Hi tech)?
thanks
Picstudent
|
|
| Back to top |
|
 |
Google AdSense

|
14 Feb 2005 5:12 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
glenjoy
Joined: 01 Jan 2004 Posts: 1028 Helped: 47 Location: Philippines
|
14 Feb 2005 5:32 hi tech printf |
|
|
|
|
putchar is letting out a hex value of a said string or ascii.
If you want to print a number, you must use the printf command with the corresponding instructions.
|
|
| Back to top |
|
 |
Picstudent
Joined: 05 May 2004 Posts: 536 Helped: 13 Location: India
|
14 Feb 2005 9:46 sprintf hitech |
|
|
|
|
| glenjoy wrote: |
If you want to print a number, you must use the printf command with the corresponding instructions. |
hai
Thanks for the reply.
The printf function by default prints into the serial port. Am I right?
If so, how to print that into LCD?
As far as I understood, it is to be done by changing the putchar function .But how?
Picstudent
|
|
| Back to top |
|
 |
C-Man
Joined: 19 Jul 2001 Posts: 1235 Helped: 73
|
14 Feb 2005 10:11 printf float hitech |
|
|
|
|
hi Picstudent,
reading this carefully should help you:
http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/11972/page//fpart/1/vc/1
best regards
|
|
| Back to top |
|
 |
Picstudent
Joined: 05 May 2004 Posts: 536 Helped: 13 Location: India
|
14 Feb 2005 12:38 hi-tech c pic sprintf |
|
|
|
|
hai
Thanks C- man for the link.
Sorry to say again that still not very clear.
They say that 'putch' is by default an empty function and to print we have to 'redifne ' it. How to do that?
Simply writing a putch(); which will print a charector in lcd or serial port and include it in our application so that printf will call it repeatedly?
Thanks
Please
Picstudent
|
|
| Back to top |
|
 |
terka
Joined: 15 Dec 2003 Posts: 102 Helped: 1
|
21 Apr 2005 22:19 hitech printf |
|
|
|
|
| Picstudent wrote: |
Hai
I have to print a float number like 32.56565 into an lcd,
Or a long number like 3256565 into lcd.
1. How can I use the 'printf ' to print this into lcd?
Hi tech manual says about writing putchar function.Where to write and how to integrate it to printf?
2.Which is the best way to do bcd conversion for this number in C (Hi tech)?
thanks
Picstudent |
Hi, using CCS PIC C:
| Code: |
float n;
printf("The Value is %2.5f, n);
//
|
%2.5f indicates: 2 int + 5 decimal, type float, print variable "n"
Bye
|
|
| Back to top |
|
 |