Colour sensors calibrated

Dependencies:   mbed-rtos mbed Servo QEI

Fork of ICRSEurobot13 by Thomas Branch

supportfuncs.h

Committer:
madcowswe
Date:
2013-04-07
Revision:
16:52250d8d8fce
Child:
19:4b993a9a156e

File content as of revision 16:52250d8d8fce:

#ifndef SUPPORTFUNCS_H
#define SUPPORTFUNCS_H

#define _USE_MATH_DEFINES
#include <cmath>

//Constrains agles to +/- pi
inline float constrainAngle(float x){
    x = fmod(x + M_PI, 2*M_PI);
    if (x < 0)
        x += 2*M_PI;
    return x - M_PI;
}

#endif //SUPPORTFUNCS_H