diff --git a/VarSpeedServo.h b/VarSpeedServo.h index 492c4c0..5364659 100644 --- a/VarSpeedServo.h +++ b/VarSpeedServo.h @@ -149,7 +149,7 @@ class VarSpeedServo public: VarSpeedServo(); uint8_t attach(int pin); // attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure - uint8_t attach(int pin, int min, int max); // as above but also sets min and max values for writes. + uint8_t attach(int pin, int min, int max, int maxAngle=180); // as above but also sets min and max values for writes. void detach(); void write(int value); // if value is < 200 its treated as an angle, otherwise as pulse width in microseconds void write(int value, uint8_t speed); // Move to given position at reduced speed. @@ -172,6 +172,7 @@ class VarSpeedServo uint8_t servoIndex; // index into the channel data for this servo int8_t min; // minimum is this value times 4 added to MIN_PULSE_WIDTH int8_t max; // maximum is this value times 4 added to MAX_PULSE_WIDTH + uint16_t maxAngle; // maximum angle for this servo servoSequencePoint * curSequence; // for sequences uint8_t curSeqPosition; // for sequences