From ebb9cebe4b7d21c80dc001a0146991437de9f7f1 Mon Sep 17 00:00:00 2001 From: Fahmi Akbar Wildana Date: Wed, 15 Apr 2015 18:43:35 +0700 Subject: [PATCH] define maximum angle useful for continuous servo --- VarSpeedServo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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