resources/libtiny/Servo.cpp
//=============================================================================
// FUNCTION:    void write(uint16_t value)
//
// DESCRIPTION: Sets the servo angle in degrees.
//              invalid angle that is valid as pulse in microseconds is
//              treated as microseconds.
//
// INPUT:       value - position for the servo to move to
//
// RETURNS:     Nothing
//
//=============================================================================
void write(uint16_t value)
DESCRIPTION: Sets the servo angle in degrees.
invalid angle that is valid as pulse in microseconds is
treated as microseconds.

position for the servo to move to

Nothing
void write ( uint16_t value ) DESCRIPTION : Sets the servo angle in degrees . invalid angle that is valid as pulse in microseconds is treated as microseconds . position for the servo to move to Nothing
void Servo::write(uint16_t value)
{
    if(servoIndex == INVALID_SERVO) return;
    if( value > 180 )
    {
        writeMicroseconds( value );
    }
    else
    {
        uint16_t servoPulseLengthInUs = map(value, 0, 180, min, max);
        writeMicroseconds( servoPulseLengthInUs );
    }
}
void Servo :: write ( uint16_t value ) { if ( servoIndex == INVALID_SERVO ) return ; if ( value > 180 ) { writeMicroseconds ( value ) ; } else { uint16_t servoPulseLengthInUs = map ( value , 0 , 180 , min , max ) ; writeMicroseconds ( servoPulseLengthInUs ) ; } }
FUNCTION:    void write(uint16_t value)
DESCRIPTION: Sets the servo angle in degrees.
FUNCTION : void write ( uint16_t value ) DESCRIPTION : Sets the servo angle in degrees .
//make sure we have a valid servo number. If it's invalid then exit doing nothing. //for now, only accept angles, and angles that are between 0 and 200 degrees //treat this number as microseconds //treat this number as degrees