Including custom Libraries

Revision as of 19:50, 15 May 2012 by Bfeher (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
General ProgrammingProgramming Tips Tricks → Including custom Libraries

Functions can have default values for their parameters, for example:

void forward( int speed = 100 )
    motor[ port2 ] = speed;   
task main()
    // Forward at default
    forward( );
    // Forward at speed 10
    forward( 10 );
    // Do nothing
    while( true ){

If the function "forward" is called with no parameters then the default of 100 is used.

If you have included your own library of functions, for example:

#include "motorLib.c"

You can suppress warnings about unused functions by including the line:

#pragma systemFile            // eliminates warning for "unreferenced" functions

in the top of that file.

This tip was posted by jpearman over at