Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 326
 2012 Microchip Technology Inc.
See Also
getch()
, getche(), putch(), cputs()
Return Value
The return value is the character passed as the sole argument.
CLRWDT 
Synopsis
#include <xc.h>
 
CLRWDT();
Description
This macro is used to clear the device’s internal watchdog timer.
Example
#include <xc.h>
void
main (void)
{
    WDTCON=1;
      /* enable the WDT */
    CLRWDT();
}
COS 
Synopsis
#include <math.h>
 
double cos (double f)
Description
This function yields the cosine of its argument, which is an angle in radians. The cosine 
is calculated by expansion of a polynomial series approximation.
Example
#include <math.h>
#include <stdio.h>
#define C 3.141592/180.0
void 
main (void)
{
    double i;
    for(i = 0 ; i <= 180.0 ; i += 10)
        printf(“sin(%3.0f) = %f, cos = %f\n”, i, sin(i*C), cos(i*C));
}
See Also
sin()
, tan(), asin(), acos(), atan(), atan2()