Skip to content

Commit d02c964

Browse files
committed
Bumped version to 3.0.0
1 parent 43130d1 commit d02c964

File tree

7 files changed

+38
-32
lines changed

7 files changed

+38
-32
lines changed

.github/workflows/PlatformIoPublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PlatformIoPublish.yml
22
# Github workflow script to publish a release to PlatformIo.
33
#
4-
# Copyright (C) 2021 Armin Joachimsmeyer
4+
# Copyright (C) 2021-2022 Armin Joachimsmeyer
55
# https://github.com/ArminJo/Github-Actions
66
#
77

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The expander in turn requires the Arduino Wire library or a [compatible one](htt
5151
For **ESP32** you need to install the Arduino ESP32Servo library.<br/>
5252
<br/>
5353
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/>
5555
For instructions how to enable these alternatives, see [Compile options / macros](https://github.com/ArminJo/ServoEasing#compile-options--macros-for-this-library).
5656

5757
# Features
@@ -170,16 +170,17 @@ Values for the MG90Sservos servos at 5 volt (4.2 volt with servo active).
170170
| 45 | 115 ms | 390 degree per second |
171171

172172
# 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/>
178178
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.
179179
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,
181182
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.
183184
Every other extension e.g. *cinclude* would do, but *hpp* seems to be common sense.
184185

185186
# 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
299300
This will print internal information visible in the Arduino *Serial Monitor* which may help finding the reason for it.
300301

301302
# 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.
304306
- 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`.
306316

307317
### Version 2.4.1
308318
- RP2040 support.

examples/QuadrupedControl/IRCommandDispatcher.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ IRCommandDispatcher IRDispatcher;
6060
#if defined(USE_TINY_IR_RECEIVER)
6161
#include "TinyIRReceiver.hpp" // included in "IRremote" library
6262

63-
#if defined(INFO)
63+
#if defined(LOCAL_INFO)
6464
#define CD_INFO_PRINT(...) Serial.print(__VA_ARGS__);
6565
#define CD_INFO_PRINTLN(...) Serial.println(__VA_ARGS__);
6666
#else
@@ -149,11 +149,9 @@ void handleReceivedIRData()
149149

150150
if (IRDispatcher.IRReceivedData.address == IR_ADDRESS) {
151151
IRDispatcher.checkAndCallCommand(true);
152-
#if defined(INFO)
153-
} else {
152+
} else {
154153
CD_INFO_PRINT(F("Wrong address. Expected 0x"));
155154
CD_INFO_PRINTLN(IR_ADDRESS, HEX);
156-
#endif
157155
}
158156
}
159157
#endif
@@ -175,14 +173,14 @@ void IRCommandDispatcher::checkAndCallCommand(bool aCallAlsoBlockingCommands) {
175173
/*
176174
* Command found
177175
*/
178-
#if defined(INFO)
176+
#if defined(LOCAL_INFO)
179177
const __FlashStringHelper *tCommandName = reinterpret_cast<const __FlashStringHelper*>(IRMapping[i].CommandString);
180178
#endif
181179
/*
182180
* Check for repeat and if it is allowed for the current command
183181
*/
184182
if (IRReceivedData.isRepeat && !(IRMapping[i].Flags & IR_COMMAND_FLAG_REPEATABLE)) {
185-
#if defined(DEBUG)
183+
#if defined(LOCAL_DEBUG)
186184
Serial.print(F("Repeats of command \""));
187185
Serial.print(tCommandName);
188186
Serial.println("\" not accepted");
@@ -194,7 +192,7 @@ void IRCommandDispatcher::checkAndCallCommand(bool aCallAlsoBlockingCommands) {
194192
* Do not accept recursive call of the same command
195193
*/
196194
if (currentBlockingCommandCalled == IRReceivedData.command) {
197-
#if defined(DEBUG)
195+
#if defined(LOCAL_DEBUG)
198196
Serial.print(F("Recursive command \""));
199197
Serial.print(tCommandName);
200198
Serial.println("\" not accepted");

examples/RobotArmControl/IRCommandDispatcher.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ IRCommandDispatcher IRDispatcher;
6060
#if defined(USE_TINY_IR_RECEIVER)
6161
#include "TinyIRReceiver.hpp" // included in "IRremote" library
6262

63-
#if defined(INFO)
63+
#if defined(LOCAL_INFO)
6464
#define CD_INFO_PRINT(...) Serial.print(__VA_ARGS__);
6565
#define CD_INFO_PRINTLN(...) Serial.println(__VA_ARGS__);
6666
#else
@@ -149,11 +149,9 @@ void handleReceivedIRData()
149149

150150
if (IRDispatcher.IRReceivedData.address == IR_ADDRESS) {
151151
IRDispatcher.checkAndCallCommand(true);
152-
#if defined(INFO)
153-
} else {
152+
} else {
154153
CD_INFO_PRINT(F("Wrong address. Expected 0x"));
155154
CD_INFO_PRINTLN(IR_ADDRESS, HEX);
156-
#endif
157155
}
158156
}
159157
#endif
@@ -175,14 +173,14 @@ void IRCommandDispatcher::checkAndCallCommand(bool aCallAlsoBlockingCommands) {
175173
/*
176174
* Command found
177175
*/
178-
#if defined(INFO)
176+
#if defined(LOCAL_INFO)
179177
const __FlashStringHelper *tCommandName = reinterpret_cast<const __FlashStringHelper*>(IRMapping[i].CommandString);
180178
#endif
181179
/*
182180
* Check for repeat and if it is allowed for the current command
183181
*/
184182
if (IRReceivedData.isRepeat && !(IRMapping[i].Flags & IR_COMMAND_FLAG_REPEATABLE)) {
185-
#if defined(DEBUG)
183+
#if defined(LOCAL_DEBUG)
186184
Serial.print(F("Repeats of command \""));
187185
Serial.print(tCommandName);
188186
Serial.println("\" not accepted");
@@ -194,7 +192,7 @@ void IRCommandDispatcher::checkAndCallCommand(bool aCallAlsoBlockingCommands) {
194192
* Do not accept recursive call of the same command
195193
*/
196194
if (currentBlockingCommandCalled == IRReceivedData.command) {
197-
#if defined(DEBUG)
195+
#if defined(LOCAL_DEBUG)
198196
Serial.print(F("Recursive command \""));
199197
Serial.print(tCommandName);
200198
Serial.println("\" not accepted");

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "git",
77
"url": "https://github.com/ArminJo/ServoEasing"
88
},
9-
"version": "2.4.1",
9+
"version": "3.0.0",
1010
"exclude": "pictures",
1111
"authors": {
1212
"name": "Armin Joachimsmeyer",

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=ServoEasing
2-
version=2.4.1
2+
version=3.0.0
33
author=Armin Joachimsmeyer
44
maintainer=Armin Joachimsmeyer <[email protected]>
55
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/>
77
category=Device Control
88
url=https://github.com/ArminJo/ServoEasing
99
architectures=avr,megaavr,sam,samd,esp8266,esp32,stm32,STM32F1,apollo3,mbed,mbed_nano,rp2040

src/ServoEasing.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/*
3434
* Macro to convert 3 version parts into an integer
35-
* To be used in preprocessor comparisons, such as #if VERSION_SERVO_EASING_HEX >= VERSION_HEX_VALUE(3, 7, 0)
35+
* To be used in preprocessor comparisons, such as #if VERSION_SERVO_EASING_HEX >= VERSION_HEX_VALUE(3, 0, 0)
3636
*/
3737
#define VERSION_HEX_VALUE(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
3838
#define VERSION_SERVO_EASING_HEX VERSION_HEX_VALUE(VERSION_SERVO_EASING_MAJOR, VERSION_SERVO_EASING_MINOR, VERSION_SERVO_EASING_PATCH)
@@ -715,9 +715,9 @@ bool checkI2CConnection(uint8_t aI2CAddress, Stream *aSerial); // Print class ha
715715
* - New function `printEasingType()`.
716716
* - Easing functions are converted to static member functions now.
717717
* - Easing types can be disabled individually.
718-
* - Improved PCA9685 handling.
718+
* - Improved PCA9685 handling / support for SoftI2CMaster.
719719
* - Changed default for parameter `doWrite` for `setTrim()` from `false` to `true`.
720-
* - Add constraint functionality and `DISABLE_MIN_AND_MAX_CONSTRAINTS`.
720+
* - Added min and max constraints for servo write() and `DISABLE_MIN_AND_MAX_CONSTRAINTS`.
721721
*
722722
* Version 2.4.1 - 02/2022
723723
* - RP2040 support added.

0 commit comments

Comments
 (0)