Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Printf in Hi-tech help!

Status
Not open for further replies.

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,463
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
 

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.
 

sprintf hitech

glenjoy said:
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
 

printf float hitech

hi Picstudent,

reading this carefully should help you:
**broken link removed**

best regards
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating
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
 

hitech printf

Picstudent said:
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
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top