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
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Contains the [QuadrupedControl](https://github.com/ArminJo/QuadrupedControl) exa
74
74
75
75
# Servo easing library for Arduino
76
76
Its purpose is to interpolate the movement between two servo positions set by software.<br/>
77
-
If your servo control data is e.g. generated by an joystick or other *"slow"* changing inputs and therefore does not change suddenly or does not jump, **you most likely do not need this library!**, you may consider to use a **digital low pass** or **[simple EMA filters](https://github.com/ArminJo/Arduino-Utils#simpleemafilterscpp)** to smooth your values used to control the servos.<br/>
77
+
If your servo control data is e.g. generated by an joystick or other *"slow"* changing inputs and therefore does not change suddenly or does not jump, **you most likely do not need this library!**, you may consider to use a **digital low pass** or **[simple EMA filters](https://github.com/ArminJo/Arduino-Utils?tab=readme-ov-file#simpleemafilters)** to smooth your values used to control the servos.<br/>
78
78
ServoEasing works with the Arduino Servo library as well as with [PCA9685 servo expanders](https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all).
79
79
The expander in turn requires the Arduino Wire library or a [compatible one](https://github.com/felias-fogg/SoftI2CMaster) and is bound to their restrictions.<br/>
80
80
For **ESP32** you need to install the Arduino ESP32Servo library.<br/>
@@ -283,9 +283,10 @@ Modify them by enabling / disabling them, or change the values if applicable.
283
283
|`PCA9685_ACTUAL_CLOCK_FREQUENCY`| 25000000L | Change it, if your PCA9685 has another than the default 25 MHz internal clock. See chapter 2 and 5 of the PCA9685 Datasheet "25 MHz typical internal oscillator requires no external components". This value is taken for all attached PCA9685 expanders! |
284
284
|`USE_SOFT_I2C_MASTER`| disabled | Saves up to 1756 bytes program memory and 218 bytes RAM for PCA9685 I2C communication compared with Arduino Wire. |
285
285
|`USE_SERVO_LIB`| disabled | Use of PCA9685 normally disables use of regular servo library. You can force additional using of regular servo library by defining `USE_SERVO_LIB`. See [below](https://github.com/ArminJo/ServoEasing?tab=readme-ov-file#using-pca9685-16-channel-servo-expander). |
286
+
|`USE_USER_PROVIDED_SERVO_LIB`| disabled | If you have a different servo implementation, e.g. this [M5Stack Servo expander](https://shop.m5stack.com/products/8-channel-servo-driver-unit-stm32f030) you can provide your own servo library by activating this macro.<br/>You must also modify the line [#include <DummyServo.h>](https://github.com/ArminJo/ServoEasing/blob/master/src/ServoEasing.h#L107) in *ServoEasing.h* according to the name of your library. |
286
287
|`PROVIDE_ONLY_LINEAR_MOVEMENT`| disabled | Disables all but LINEAR movement. Saves up to 1540 bytes program memory. |
287
288
|`DISABLE_COMPLEX_FUNCTIONS`| disabled | Disables the SINE, CIRCULAR, BACK, ELASTIC, BOUNCE and PRECISION easings. Saves up to 1850 bytes program memory. |
288
-
|`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! |
289
+
|`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/>Then of course all *AllServos*() functions and isOneServoMoving() also can't work correctly! |
289
290
|`DISABLE_MICROS_AS_DEGREE_PARAMETER`| disabled | Disables passing also microsecond values as (target angle) parameter. Saves up to 128 bytes program memory. |
290
291
|`DISABLE_MIN_AND_MAX_CONSTRAINTS`| disabled | Disables servo movement constraints. Saves 4 bytes RAM per servo but strangely enough no program memory. |
291
292
|`DISABLE_PAUSE_RESUME`| disabled | Disables pause and resume functionality. Saves 5 bytes RAM per servo. |
@@ -354,6 +355,9 @@ If you **detach** a servo and then attach another one, the latter will get the i
354
355
# Examples for this library
355
356
[The examples](https://github.com/ArminJo/ServoEasing/blob/master/examples#servoeasing-examples) are available at File > Examples > Examples from Custom Libraries / ServoEasing.<br/>
356
357
358
+
## DummyServoExample
359
+
This is an example for a user provided servo library, which is activated by `#define USE_USER_PROVIDED_SERVO_LIB`.
360
+
357
361
<br/>
358
362
359
363
# WOKWI online examples
@@ -436,6 +440,7 @@ This will print internal information visible in the Arduino *Serial Monitor* whi
436
440
- Added functions `setEaseTo()`, `setEaseToD()`, `startEaseTo()` and `startEaseToD()` with first parameter as `unsigned int` to avoid compiler errors `call of overloaded 'startEaseTo(unsigned int...`.
437
441
- Added functions read() and readMicroseconds() to be compatible to Servo library.
438
442
- Added function reattach() without parameters to be used after detach().
443
+
- Added `USE_USER_PROVIDED_SERVO_LIB` macro.
439
444
440
445
### Version 3.2.1
441
446
- Renamed function `setDegreeForAllServos()` to `setIntegerDegreeForAllServos()` and added function `setFloatDegreeForAllServos()`.
0 commit comments