Skip to content

Commit ce249c7

Browse files
committed
Live setup, documentation and example
1 parent 6802fa2 commit ce249c7

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,32 @@ used only for servos and positions for which setDetach(true) is specified.
194194
Update the positions of all the servos. This class function has to be called
195195
in loop() as frequently as possible.
196196

197+
## Live adjustement of minimum and maximum position
198+
199+
With version 1.1, 5 functions have been added to implement live adjustement of minimum and maximum positions. When an adjustement of a servo is in progress, the goTo, goToMin and goToMax functions fail silently.
200+
201+
Entering in live adjustement process is done implicitely by calling one of the for adjust functions. Exiting the live adjustement process is done by calling de ```endAdjust()``` function.
202+
203+
### setupMin(minPulse)
204+
205+
```setupMin()``` sets the minimum pulse value. ```minPulse``` is an unsigned 16 bits integer. The servo enters in the live adjustement process: its state is saved, the minimum pulse is set to ```minPulse``` and it goes to the new minimum position so that the user can see it. If ```minPulse``` is greater than the maximum pulse, it is set back to the maximum pulse. If ```minPulse``` is lower than the minimum possible value of the Servo library (544), it is set back to the minimum possible value.
206+
207+
### setupMax(maxPulse)
208+
209+
```setupMax()``` sets the maximum pulse value. ```maxPulse``` is an unsigned 16 bits integer. The servo enters in the live adjustement process: its state is saved, the maximum pulse is set to ```maxPulse``` and it goes to the new maximum position so that the user can see it. If ```maxPulse``` is lower than the minimum pulse, it is set back to the minimum pulse. If ```maxPulse``` is greater than the maximum possible value of the Servo library (2400), it is set back to the maximum possible value.
210+
211+
### adjustMin(increment)
212+
213+
```adjustMin()``` adds ```increment``` to the minimum position. ```increment``` is a signed 16 bits integer. The servo enters in the live adjustement process: its state is saved, ```increment``` is added to the minimum pulse and it goes to the new minimum position so that the user can see it. If after adding ```increment```, the minimum pulse is greater than the maximum pulse, it is set back to the maximum pulse. If after adding ```increment```, the minimum pulse is lower than the minimum possible value of the Servo library (544), it is set back to the minimum possible value.
214+
215+
### adjustMax(increment)
216+
217+
```adjustMax()``` adds ```increment``` to the maximum position. ```increment``` is a signed 16 bits integer. The servo enters in the live adjustement process: its state is saved, ```increment``` is added to the maximum pulse and it goes to the new maximum position so that the user can see it. If after adding ```increment```, the maximum pulse is lower than the minimum pulse, it is set back to the minimum pulse. If after adding ```increment```, the maximum pulse is greater than the maximum possible value of the Servo library (2400), it is set back to the maximum possible value.
218+
219+
### endAdjust()
220+
221+
After calling the 4 previous function, ```endAdjust()``` shall be called to exit the adjustement process. The state of the servo is restored. However it does not returns to the position it was before the adjustement process.
222+
197223
## Example
198224

199225
Let's drive a single servo with a smooth movement forward and backward.

changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+---------------------------------------------------------------------------+
22
| SlowMotionServo changelog |
33
+---------------------------------------------------------------------------+
4-
1.0.7 Added methods to support live min max settings
4+
1.1 Added methods to support live min max settings
55
1.0.6 Release to fix the problem of the duplicated 1.0.5. Nothing new
66
1.0.5 Minor fix in one of the accessor name
77
1.0.4 Added accessors to get almost all attributes of a SMS object

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SlowMotionServo
2-
version=1.0.7
2+
version=1.1
33
author=Jean-Luc - Locoduino
44
maintainer=Jean-Luc - Locoduino
55
sentence=This library allows to move multiple servos slowly.

0 commit comments

Comments
 (0)