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
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,22 +108,22 @@ For instructions how to enable these alternatives, see [Compile options / macros
108
108
109
109
110
110
### All easing functions can be used in the following variants:
111
-
All ease functions are called internally with the value: `PercentageOfCompletion / 100`resulting in values from 0 and 1.
111
+
All ease functions are called internally with the value: `PercentageOfCompletion / 100`giving a call value from 0 to 1.
112
112
113
-
- In (start the function with 0 and go to 1) for PRECISION, do a bounce if approaching from above (go in to origin), else linear.
114
-
- Out (start the function with 1 and go to 0) for PRECISION, do a bounce if approaching from below (go out from origin), else linear.
115
-
- InOut (start the function with 0 go to 1 and back to 0)
116
-
- Bouncing (start with OUT, then return with IN to start degree) e.g. Bouncing of the Sine function results in the upper (positive) half of the sine.
113
+
- In: Start the function with 0 and go to 1 linear. Except for PRECISION, where we do a bounce if approaching from above (go in to origin).
114
+
- Out: Start the function with 1 and go to 0 linear. Except for PRECISION, where we do a bounce if approaching from below (go out from origin).
115
+
- InOut: Start the function with 0 go to 1 and back to 0.
116
+
- Bouncing: Start with OUT, then return with IN to start degree. E.g. Bouncing of the SINE function results in the upper (positive) half of the sine.
117
117
118
-
All easing types (starting in flavor IN_OUT, then IN, OUT and BOUNCE) in one plot.<br/>
118
+
#### All easing types (starting in flavor IN_OUT, then IN, OUT and BOUNCE) in one plot.<br/>
119
119
Since the values are computed in a fixed 20 ms raster, the last degree increment or decrement
120
120
in an easing may be much smaller than the increment/decrement before,
121
121
resulting in some small discontinuities between adjacent movements.<br/>
122
122

123
123
124
124
### Constraints
125
125
To restrict servo movements to a fixed range, you can specify constraints with `setMinMaxConstraint(int aMinDegreeOrMicrosecond, int aMaxDegreeOrMicrosecond)`.<br/>
126
-
Arduino Plotter Output with constraints at 5 degree and 175 degree activated.
126
+
#### Arduino Plotter Output with constraints at 5 degree and 175 degree activated.
127
127

128
128
129
129
### Disable easing temporarily
@@ -160,7 +160,7 @@ Just call `myServo.startEaseTo()` instead of `myServo.write()` and you are done.
160
160
<br/>
161
161
162
162
# Multiple servo handling
163
-
You can handle multiple servos simultaneously by [special functions](https://github.com/ArminJo/ServoEasing/blob/master/src/ServoEasing.h#L667) like
163
+
You can handle multiple servos simultaneously by [special functions](https://github.com/ArminJo/ServoEasing/blob/master/src/ServoEasing.h#L674) like
164
164
`writeAllServos()`, `setSpeedForAllServos()`, `setDegreeForAllServos()`, `setEaseToDForAllServos()`, `updateAndWaitForAllServosToStop()`, `setEaseToForAllServosSynchronizeAndWaitForAllServosToStop()`, `setEaseToForAllServosSynchronizeAndStartInterrupt()` and much more.<br/>
- Servo signal gif from https://workshop.pglu.ch/arduino-servo/
181
181
[](https://workshop.pglu.ch/arduino-servo/)
@@ -271,7 +271,7 @@ Modify them by enabling / disabling them, or change the values if applicable.
271
271
|`PROVIDE_ONLY_LINEAR_MOVEMENT`| disabled | Disables all but LINEAR movement. Saves up to 1540 bytes program memory. |
272
272
|`DISABLE_COMPLEX_FUNCTIONS`| disabled | Disables the SINE, CIRCULAR, BACK, ELASTIC, BOUNCE and PRECISION easings. Saves up to 1850 bytes program memory. |
273
273
|`MAX_EASING_SERVOS`| 12, 16(for PCA9685) | Saves 4 byte RAM per servo. If this value is smaller than the amount of servos declared, attach() will return error and other library functions will not work as expected.<br/>Of course all *AllServos*() functions and isOneServoMoving() can't work correctly! |
274
-
|`DISABLE_MICROS_AS_DEGREE_PARAMETER`| disabled | Disables passing also microsecond values as (target angle) parameter (see [OneServo example](https://github.com/ArminJo/ServoEasing/blob/master/examples/OneServo/OneServo.ino#L93)). Saves up to 128 bytes program memory. |
274
+
|`DISABLE_MICROS_AS_DEGREE_PARAMETER`| disabled | Disables passing also microsecond values as (target angle) parameter. Saves up to 128 bytes program memory. |
275
275
|`DISABLE_MIN_AND_MAX_CONSTRAINTS`| disabled | Disables servo movement constraints. Saves 4 bytes RAM per servo but strangely enough no program memory. |
276
276
|`DISABLE_PAUSE_RESUME`| disabled | Disables pause and resume functionality. Saves 5 bytes RAM per servo. |
277
277
|`PRINT_FOR_SERIAL_PLOTTER`| disabled | Generate serial output for Arduino Plotter (Ctrl-Shift-L). |
@@ -281,7 +281,7 @@ Modify them by enabling / disabling them, or change the values if applicable.
281
281
<br/>
282
282
283
283
# Using PCA9685 16-Channel Servo Expander
284
-
Using the expander makes the servo pulse generating immune to other libraries blocking interrupts for a longer time like SoftwareSerial, Adafruit_NeoPixel and DmxSimple.<br/>
284
+
Using the PCA9685 expander makes the servo pulse generating immune to other libraries blocking interrupts for a longer time like SoftwareSerial, Adafruit_NeoPixel and DmxSimple.<br/>
285
285
To enable the use of the expander, activate [the line `#define USE_PCA9685_SERVO_EXPANDER`](https://github.com/ArminJo/ServoEasing/blob/master/examples/OneServo/OneServo.ino#L28) before `#include <ServoEasing.hpp>`.<br/>
286
286
In expander mode, timer1 is only required for the startEaseTo* functions and not for the blocking easeTo* functions, since no servo signal must be generated by it.
287
287
@@ -316,14 +316,14 @@ The ServoEasing library provides two arrays to ease the handling of multiple ser
316
316
317
317
Every ServoEasing object is appended to the ServoEasingArray by the attach() function.
318
318
**Only the order of the attach() statements determines the position in the array.**
319
-
So you can access your servo, which you attached secondly, also by `ServoEasing::ServoEasingArray[1]->setEaseTo(135)` as it is done [here](https://github.com/ArminJo/ServoEasing/blob/master/examples/ThreeServos/ThreeServos.ino#L144).<br/>
319
+
So you can access your servo, which you attached secondly, also by `ServoEasing::ServoEasingArray[1]->setEaseTo(135)` as it is done [here](https://github.com/ArminJo/ServoEasing/blob/master/examples/ThreeServos/ThreeServos.ino#L149).<br/>
320
320
There are also many other `*AllServos*` functions like `stopAllServos()`.
321
321
322
322
To move multiple servo, you can fill up the `ServoEasing::ServoEasingNextPositionArray` with the desired positions and then use e.g. the function `setEaseToForAllServos()`.
323
323
Then you must enable interrupt with `enableServoEasingInterrupt()` or call `updateAllServos()` in your main loop until it returns true.<br/>
324
324
If you want to move all your servos synchronized, i.e. they all stop at the same time,
325
325
you can use the `setEaseToForAllServosSynchronizeAndWaitForAllServosToStop()` or `setEaseToForAllServosSynchronizeAndStartInterrupt` function.<br/>
326
-
An example can be found [here](https://github.com/ArminJo/ServoEasing/blob/master/examples/ThreeServos/ThreeServos.ino#L162).<br/>
326
+
An example can be found [here](https://github.com/ArminJo/ServoEasing/blob/master/examples/ThreeServos/ThreeServos.ino#L174).<br/>
327
327
The [Quadruped example](https://github.com/ArminJo/ServoEasing/blob/master/examples/QuadrupedControl/QuadrupedServoControl.hpp#L32) makes heavy use of the `*AllServos*` functions.
328
328
329
329
If you **detach** a servo and then attach another one, the latter will get the index of the former detached one.
@@ -357,7 +357,7 @@ The API accepts degrees or microseconds as float or integer values, but internal
357
357
358
358
# Supported Arduino architectures
359
359
**Every Arduino architecture with a Servo library** will work without any modifications in blocking mode.<br/>
360
-
Non blocking behavior can always be achieved manually by calling `update()` in a loop - see last movement in [Simple example](examples/Simple/Simple.ino).<br/>
360
+
Non blocking behavior can always be achieved manually by calling `update()`or `updateAllServos()`in a loop - see [ThreeServos example](examples/ThreeServos/ThreeServos.ino#L153).<br/>
361
361
Interrupt based movement (movement without calling `update()` manually in a loop) is supported for the following Arduino architectures:<br/>
362
362
**avr, megaavr, sam, samd, esp8266, esp32, stm32, STM32F1 and apollo3.**<br/>
363
363
**It is not planned to support the ATtiny architecture, but you are invited to [do it by yourself](https://github.com/ArminJo/ServoEasing#adding-a-new-platform--board) and send a pull request.**
@@ -379,7 +379,7 @@ On **AVR** Timer1 is used for the Arduino Servo library. To have non blocking ea
379
379
| Teensy || IntervalTimer |
380
380
| apollo3 | timer 3 segment A ||
381
381
| Mbed | mbed::Ticker | Ticker.h |
382
-
|[RP2040 / Pi Pico](https://github.com/earlephilhower/arduino-pico|[default alarm pool](https://raspberrypi.github.io/pico-sdk-doxygen/group__repeating__timer.html)| time.h |
382
+
|[RP2040 / Pi Pico](https://github.com/earlephilhower/arduino-pico)|[default alarm pool](https://raspberrypi.github.io/pico-sdk-doxygen/group__repeating__timer.html)| time.h |
383
383
384
384
<br/>
385
385
@@ -404,7 +404,8 @@ This will print internal information visible in the Arduino *Serial Monitor* whi
404
404
<br/>
405
405
406
406
# Revision History
407
-
### Version 3.1.1
407
+
### Version 3.2.0
408
+
- ATmega4808 support added.
408
409
- Added function `getCurrentMicroseconds()`.
409
410
- Improved many and added workaround for ESP32 bug in while loops in examples.
0 commit comments