
Chapter 3 Terminal Specific Function Library
87
For any of the above displays, when ICON_ZONE is enabled, the entire screen
will be erased after calling clr_scr().
Note that the system may still show the status icons in this icon area, even
though ICON_ZONE is enabled. This is because these status icons are
constantly maintained by the system, and they may override the printing of
characters from time to time.
Return
None
printf
Purpose
To write character strings and values of C variables in a specified format to the
LCD.
Syntax
int printf (char *format, var...);
char *format; /* character string that describes the format to be used */
var...; /* any variable whose value is being printed on the LCD */
Example
pritnf ("ID: %s", id_buffer);
Description
This routine accepts any variable and prints its value to the LCD. The value of
each variable is formatted according to the codes embedded in the format
specification
format
.
To print values of C variables, a format specification must be embedded in
format
for each variable to be printed. The format specification for each
variable has the following form:
%[flags][width].[precision][size][type]
Field
Explanation
% (required)
Indicates the beginning of a format specification. Use
%% to print a percentage sign.
flags (optional)
One of more of the '-', '+', '#' characters or a blank space
specifies justification, and the appearance of plus/minus
signs in the values printed (see below).
width (optional)
A number that indicates how many characters, at
maximum, must be used to print the value.
precision (optional) A number that indicates how many characters, at
maximum, can be used to print the value.
When printing integer variables, this is the minimum
number of digits used.
size (optional)
A character that modifies the type field which comes
next. One of the characters 'h', 'l', and 'L' can appear in
this field to differentiate between short and long
integers. 'h' is for short integers, and 'l' or 'L' for long
integers.
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...