Closed BanksySan closed 2 years ago
The documentation says that .attach(pin) should return the pin assigned or 0 in the case of a failure.
.attach(pin)
0
When I check the returned value it's always 0, regardless of failure:
#include <Servo.h> Servo servo; void setup() { Serial.begin(9600); byte b = servo.attach(2); while(!Serial) { ; } Serial.println("Ready\n====="); Serial.println("Pin attached: " + String(b)); }
Output:
Ready===== Pin attached: 0
The documentation says that
.attach(pin)
should return the pin assigned or0
in the case of a failure.When I check the returned value it's always
0
, regardless of failure:Output: