electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Printf in Hi-tech help!


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Printf in Hi-tech help!
Author Message
Picstudent



Joined: 05 May 2004
Posts: 536
Helped: 13
Location: India


Post14 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
Google Adsense




Post14 Feb 2005 5:12   

Ads




Back to top
glenjoy



Joined: 01 Jan 2004
Posts: 1028
Helped: 47
Location: Philippines


Post14 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


Post14 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


Post14 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


Post14 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


Post21 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
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Printf in Hi-tech help!
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
CodeVision AVR printf function for second UART! Need Help (2)
[Help] Hi-tech PIC C Beginner need help on i/o (15)
HI-Tech HELP (2)
SE vendor Tech' help!!!!! (1)
printf with usart (5)
why TI=1 before printf()? (9)
printf in embedded C compilers. (9)
keil printf redirection (2)
MPLAB -HI TECh Simulator Help! (1)
hi-tech pic c help need???????????????????? (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS