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
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ The expander in turn requires the Arduino Wire library or a [compatible one](htt
51
51
For **ESP32** you need to install the Arduino ESP32Servo library.<br/>
52
52
<br/>
53
53
If you require only one or two servos, you may want to use the included [LightweightServo library](https://github.com/ArminJo/LightweightServo) (only for **AVR**), instead of the Arduino Servo library.
54
-
The LightweightServo library uses the internal Timer1 with no software overhead and therefore has no problems with **servo jittering** or interrupt blocking libraries like SoftwareSerial, Adafruit_NeoPixel and DmxSimple.<br/>
54
+
The LightweightServo library uses the internal Timer1 with no software overhead and therefore has no problems with **servo twitching** or interrupt blocking libraries like SoftwareSerial, Adafruit_NeoPixel and DmxSimple.<br/>
55
55
For instructions how to enable these alternatives, see [Compile options / macros](https://github.com/ArminJo/ServoEasing#compile-options--macros-for-this-library).
56
56
57
57
# Features
@@ -170,16 +170,17 @@ Values for the MG90Sservos servos at 5 volt (4.2 volt with servo active).
170
170
| 45 | 115 ms | 390 degree per second |
171
171
172
172
# Why *.hpp files instead of *.cpp files?
173
-
**Every *.cpp file is compiled separately** by a call of the compiler only compiling this file. These calls are managed by the IDE / make system.
174
-
In the Arduino IDE they are issued when you click on *Verify* or *Upload*.<br/>
175
-
The problem is: **How to set [compile options](#compile-options--macros-for-this-library) for all *.cpp files, especially for libraries used?**<br/>
176
-
IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or [PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to set this options per project.
177
-
They in turn add these options to each compiler call e.g. `-DTRACE`.<br/>
173
+
**Every \*.cpp file is compiled separately** by a call of the compiler exclusively for this cpp file. These calls are managed by the IDE / make system.
174
+
In the Arduino IDE the calls are executed when you click on *Verify* or *Upload*.<br/>
175
+
And now our problem with Arduino is: **How to set [compile options](#compile-options--macros-for-this-library) for all *.cpp files, especially for libraries used?**<br/>
176
+
IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or [PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to specify a set of options per project.
177
+
They add these options at each compiler call e.g. `-DTRACE`.<br/>
178
178
But Arduino lacks this feature. So the **workaround** is not to compile all sources separately, but to concatenate them to one huge source file by including them in your source.
179
179
This is done by e.g. `#include "ServoEasing.hpp"`.<br/>
180
-
But why not `#include "ServoEasing.cpp"`? Try it and you will see tons of errors, because each function of the *.cpp file is compiled twice,
180
+
But why not `#include "ServoEasing.cpp"`?<br/>
181
+
Try it and you will see tons of errors, because each function of the *.cpp file is now compiled twice,
181
182
first by compiling the huge file and second by compiling the *.cpp file separately, like described above.
182
-
So the extension *cpp* is not longer possible, and one solution is, to use *hpp* as extension, to show that it is an included *.cpp file.
183
+
So using the extension *cpp* is not longer possible, and one solution is to use *hpp* as extension, to show that it is an included *.cpp file.
183
184
Every other extension e.g. *cinclude* would do, but *hpp* seems to be common sense.
184
185
185
186
# Using the new *.hpp files / how to avoid `multiple definitions` linker errors
@@ -299,10 +300,19 @@ If you see strange behavior, you can open the library file *ServoEasing.h* and a
299
300
This will print internal information visible in the Arduino *Serial Monitor* which may help finding the reason for it.
300
301
301
302
# Revision History
302
-
### Version 2.5.0
303
-
- Changed ENABLE_MICROS_AS_DEGREE_PARAMETER to DISABLE_MICROS_AS_DEGREE_PARAMETER thus enabling micros as parameter by default.
303
+
### Version 3.0.0
304
+
- Added target reached callback functionality, to enable multiple movements without loop control.
305
+
- Changed `ENABLE_MICROS_AS_DEGREE_PARAMETER` to `DISABLE_MICROS_AS_DEGREE_PARAMETER` thus enabling micros as parameter by default.
304
306
- Fixed some bugs for micros as parameter.
305
-
- Improved PCA9685 handling.
307
+
- Changed constants for easing types.
308
+
- Additional parameter aUserDataPointer for user easing function.
309
+
- New easing type `PRECISION`.
310
+
- New function `printEasingType()`.
311
+
- Easing functions are converted to static member functions now.
312
+
- Easing types can be disabled individually.
313
+
- Improved PCA9685 handling / support for SoftI2CMaster.
314
+
- Changed default for parameter `doWrite` for `setTrim()` from `false` to `true`.
315
+
- Added min and max constraints for servo write() and `DISABLE_MIN_AND_MAX_CONSTRAINTS`.
sentence=Enables smooth servo movement. <br/>Linear as well as other (Cubic, Circular, Bounce, etc.) ease movements for servos are provided. The Arduino Servo library or PCA9685 servo expanders are supported.<br/>
6
-
paragraph=Just use <b>myServo.easeTo()</b> instead of <b>myServo.write()</b> and you have smooth servo movement.<br/><b>Non blocking</b> movement for all servos attached to the Arduino Servo library is implemented by reusing the interrupts of the Arduino servo timer.<br/><b>All servos can move synchronized.</b><br/><br/>Includes the following <b>easing functions</b>:<ul><li><b>Linear</b>, <b>Quadratic</b>, <b>Cubic</b> and <b>Quartic</b></li><li><b>Sine</b>, <b>Circular</b>, <b>Back</b>, <b>Elastic</b> and <b>Bounce</b></li><li><b>User defined</b></li></ul>Each function supports the <b>easing types</b> <b>In</b>, <b>Out</b>, <b>InOut</b> and <b>BouncingOutIn</b><br/>Trim and reverse operations are supported as well as continuous rotating servos.<br/><br/><b>New: </b>RP2040 support.<br/><a href="https://github.com/ArminJo/ServoEasing#revision-history">Revision History</a><br/>
6
+
paragraph=Just use <b>myServo.easeTo()</b> instead of <b>myServo.write()</b> and you have smooth servo movement.<br/><b>Non blocking</b> movement for all servos attached to the Arduino Servo library is implemented by reusing the interrupts of the Arduino servo timer.<br/><b>All servos can move synchronized.</b><br/><br/>Includes the following <b>easing functions</b>:<ul><li><b>Linear</b>, <b>Quadratic</b>, <b>Cubic</b> and <b>Quartic</b></li><li><b>Sine</b>, <b>Circular</b>, <b>Back</b>, <b>Elastic</b> and <b>Bounce</b></li><li><b>User defined</b></li></ul>Each function supports the <b>easing types</b> <b>In</b>, <b>Out</b>, <b>InOut</b> and <b>BouncingOutIn</b><br/>Trim and reverse operations are supported as well as continuous rotating servos.<br/><br/><b>New: </b>New easing type PRECISION. Added min and max constraints for servo write(). Changed constants for easing types. Fixed some bugs for micros as parameter.<br/><a href="https://github.com/ArminJo/ServoEasing#revision-history">Revision History</a><br/>
0 commit comments