17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

fabs( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

result=fabs (value)<br />

value is a float<br />

result is a float<br />

The fabs function computes the absolute value of a float<br />

All devices.<br />

#INCLUDE <br />

float result;<br />

result=fabs(-40.0)<br />

// result is 40.0<br />

None<br />

abs(), labs()<br />

getc( ) getch( ) getchar( ) fgetc( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

value = getc()<br />

value = fgetc(stream)<br />

value=getch()<br />

value=getchar()<br />

stream is a stream identifier (a constant byte)<br />

An 8 bit character<br />

This function waits for a character to come in over the RS232 RCV pin and returns the<br />

character. If you do not want to hang forever waiting for an incoming character use<br />

kbhit() to test for a character available. If a built-in USART is used the hardware can<br />

buffer 3 characters otherwise GETC must be active while the character is being<br />

received by the PIC®.<br />

If fgetc() is used then the specified stream is used where getc() defaults to STDIN (the<br />

last USE RS232).<br />

Availability:<br />

Requires:<br />

All devices<br />

#USE RS232<br />

178

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!