Skip to content

Commit 381b581

Browse files
committed
add servo based on reference
1 parent 8eac7f1 commit 381b581

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/BlenderServoAnimation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ Animation::Animation(byte fps, int frames) {
1212
this->frames = frames;
1313
}
1414

15-
void Animation::addServo(Servo servo) {
15+
void Animation::addServo(Servo &servo) {
1616
byte id = servo.getID();
1717
this->servos[id] = &servo;
1818
}
1919

2020
void Animation::addServos(Servo servos[], byte servoAmount) {
2121
for (int i = 0; i < servoAmount; i++) {
22-
byte id = servos[i].getID();
23-
this->servos[id] = &servos[i];
22+
this->addServo(servos[i]);
2423
}
2524
}
2625

src/BlenderServoAnimation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Animation {
4242

4343
Animation(byte fps, int frames);
4444

45-
void addServo(Servo servo);
45+
void addServo(Servo &servo);
4646

4747
void addServos(Servo servos[], byte servoAmount);
4848

0 commit comments

Comments
 (0)