User manual

Table Of Contents
644
mikoC PRO for PIC32
MikroElektronika
Parameters The precision eld is a non-negative number that species the number of characters to print,
number of signicant digits, or number of decimal places. The precision eld can cause truncation or
rounding of the output value in the case of a oating-point number as specied in the following table.
The optional characters l or L may immediately precede conversion_type to respectively specify
long versions of the integer types d, i, u, o, x, and X.
You must ensure that the argument type matches that of the format specication. You can use type
casts to ensure that the proper type is passed to printout.
ags
Meaning of the precision eld
d, u, o, x, X
The precision eld is where you specify the minimum number of digits that will
be included in the output value. Digits are not truncated if the number of digits
in an argument exceeds that dened in the precision eld. If the number of
digits in the argument is less than the precision eld, the output value is padded
on the left with zeros.
f
The precision eld is where you specify the number of digits to the right of the
decimal point. The last digit is rounded.
e, E
The precision eld is where you specify the number of digits to the right of the
decimal point. The last digit is rounded.
g
The precision eld is where you specify the maximum number of signicant
digits in the output value.
c, C
The precision eld has no effect on these eld types.
s
The precision eld is where you specify the maximum number of characters in
the output value. Excess characters are not output.
Returns Nothing.
Requires Nothing.
Example Print mikroElektronika example’s header le to UART.
void PrintHandler(char c){
UART1_Write(c);
}
void main(){
UART1_Init(9600);
Delay_ms(100);
PrintOut(PrintHandler, “/*\r\n”
“ * Project name:\r\n”
“ PrintOutExample (Sample usage of PrintOut()
function)\r\n”
“ * Copyright:\r\n”
“ (c) MikroElektronika, 2006.\r\n”
“ * Revision History:\r\n”
“ 20060710:\r\n”