Skip to content

Commit 6af36d2

Browse files
committed
remove default servo threshold
1 parent d8e6227 commit 6af36d2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Servo(id, callback, threshold);
6969
| id | byte | Unique servo ID as specified via the Add-on |
7070
| positions | const int[] | Exported positions per frame |
7171
| callback | void (byte, int) | Function to trigger when a servo is moved |
72-
| threshold | byte | Max allowed position diff (default=20) |
72+
| threshold | byte | Max allowed position diff (default=0 / no threshold handling) |
7373
7474
### Callback Function
7575

src/internal/Servo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void Servo::move(int position, bool force) {
2424
}
2525

2626
int positionDiff = abs(position - this->currentPosition);
27-
bool exceedsThreshold = positionDiff > this->threshold;
27+
bool exceedsThreshold = this->threshold && positionDiff > this->threshold;
2828

2929
if (this->currentPosition > 0 && exceedsThreshold) {
3030
return;

src/internal/Servo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class Servo {
2121
cb moveCallback;
2222

2323
public:
24-
Servo(byte id, const int positions[], cb moveCallback, byte threshold = 20);
25-
Servo(byte id, cb moveCallback, byte threshold = 20);
24+
Servo(byte id, const int positions[], cb moveCallback, byte threshold = 0);
25+
Servo(byte id, cb moveCallback, byte threshold = 0);
2626

2727
void move(int position, bool force = false);
2828
void moveByFrame(int frame);

0 commit comments

Comments
 (0)