Hi-Tech PICC - problem understanding purpose of printf

Status
Not open for further replies.

the_merovingian

Member level 1
Joined
Jul 25, 2009
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
UK
Activity points
1,558
I've always programmed my PICs using assembler in the past but have decided to take a look into Hi-Tech's PICC Lite compiler.

I'm confident and competent in using C on a PC (for Linux) but I'm struggling to understand the purpose of printf on a PIC.

What would it do on a PIC16F627A - there is no STDOUT?!

Any help (or decent tutorials) appreciated.

Thanks in advance.
 

You supply a function that printf calls to output each character. You can use this fucntion to send data to a serial port, an LCD, printer....whatever output you want.
 
Ah ha! That makes sense! Many thanks. That would be useful for projects with an LCD.

I see the magical template file is found in the lib directory of the compiler distribution and is called 'doprnt.c'.

Any examples available online?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…