|
@@ -6,13 +6,17 @@
|
6
|
6
|
|
7
|
7
|
#include "HAL_Servo_Teensy.h"
|
8
|
8
|
|
|
9
|
+uint8_t servoPin[MAX_SERVOS] = { 0 };
|
|
10
|
+
|
9
|
11
|
int8_t libServo::attach(const int pin) {
|
10
|
12
|
if (this->servoIndex >= MAX_SERVOS) return -1;
|
11
|
|
- return Servo::attach(pin);
|
|
13
|
+ if (pin > 0) servoPin[this->servoIndex] = pin;
|
|
14
|
+ return Servo::attach(servoPin[this->servoIndex]);
|
12
|
15
|
}
|
13
|
16
|
|
14
|
17
|
int8_t libServo::attach(const int pin, const int min, const int max) {
|
15
|
|
- return Servo::attach(pin, min, max);
|
|
18
|
+ if (pin > 0) servoPin[this->servoIndex] = pin;
|
|
19
|
+ return Servo::attach(servoPin[this->servoIndex], min, max);
|
16
|
20
|
}
|
17
|
21
|
|
18
|
22
|
void libServo::move(const int value) {
|