File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ write KEYWORD2
1818writeMicroseconds KEYWORD2
1919read KEYWORD2
2020readMicroseconds KEYWORD2
21+ attached KEYWORD2
2122
2223#######################################
2324# Constants (LITERAL1)
Original file line number Diff line number Diff line change @@ -458,4 +458,8 @@ int Servo::readMicroseconds() {
458458
459459 return this ->pulseWidth ;
460460}
461+
462+ bool Servo::attached () {
463+ return pinActive[this ->servoIndex ] == BOOL_TRUE;
464+ }
461465#endif
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ class Servo
7878 void writeMicroseconds (int value); // write pulse width in microseconds
7979 int read (); // returns the current write angle in degrees
8080 int readMicroseconds (); // returns the current write angle in microseconds
81+ bool attached (); // returns true if this servo is attached, otherwise false
8182
8283private:
8384 uint8_t servoIndex; // number of attached Servos
You can’t perform that action at this time.
0 commit comments