rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue May 18, 2004 7:11 am |
|
|
printf() is typically re-entrant for any compiler so it should not appear in interrupt service routines. It is OK for use in main() or a subroutine.
Code: |
printf("Hello world, the numbers are %f and %e\r\n", fnum1, fnum2);
|
The first number, fnum1 will print as a "standard" floating point while fnum2 will print using exponential format. You can modify the %f or %e to change the number of decimal points and field width. Refer to a C language reference such as K & R's book.
The CCS help file gives some simple examples, especially if you need to see how to use streams. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|