You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,32 @@ used only for servos and positions for which setDetach(true) is specified.
194
194
Update the positions of all the servos. This class function has to be called
195
195
in loop() as frequently as possible.
196
196
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
+
197
223
## Example
198
224
199
225
Let's drive a single servo with a smooth movement forward and backward.
0 commit comments