pic32/libraries/SoftPWMServo/SoftPWMServo.cpp
/*
 * Record the pin, min and max pulse widths for this SoftServo object
 * For some reason, some sketches think that sending in -1 for min or max
 * will make them take on their 'default' values. Well, OK then.
 */
Record the pin, min and max pulse widths for this SoftServo object
For some reason, some sketches think that sending in -1 for min or max
will make them take on their 'default' values. Well, OK then.
Record the pin min and max pulse widths for this SoftServo object For some reason some sketches think that sending in - 1 for min or max will make them take on their ' default ' values . Well OK then .
uint8_t SoftServo::attach(int pin, int min, int max)
{
    this->pin = pin;
    if (min != -1)
    {
        this->min = min;
    }
    else
    {
        this->min = MIN_PULSE_WIDTH;
    }
    if (max != -1)
    {
        this->max = max;
    }
    else
    {
        this->max = MAX_PULSE_WIDTH;
    }
    this->write(DEFAULT_PULSE_WIDTH);
    this->isAttached = true;
    return this->pin;
}
uint8_t SoftServo :: attach ( int pin , int min , int max ) { this -> pin = pin ; if ( min != -1 ) { this -> min = min ; } else { this -> min = MIN_PULSE_WIDTH ; } if ( max != -1 ) { this -> max = max ; } else { this -> max = MAX_PULSE_WIDTH ; } this -> write ( DEFAULT_PULSE_WIDTH ) ; this -> isAttached = true ; return this -> pin ; }
Record the pin, min and max pulse widths for this SoftServo object
 For some reason, some sketches think that sending in -1 for min or max
 will make them take on their 'default' values.
Record the pin min and max pulse widths for this SoftServo object For some reason some sketches think that sending in - 1 for min or max will make them take on their ' default ' values .
// Always start out at the default pulse width and turn on the output