Closed
Description
The following code works as expected with my Arduino Uno board, but doesn't work with my ESP8266 based board. Once a servo is detached, the code can't control the servo anymore. According to the Library Manager, the version of the Servo library is 1.1.0.
#include <Servo.h>
Servo servo;
const int servoPin = 2;
void setup() {
servo.attach(servoPin);
servo.write(90);
delay(500);
servo.detach();
delay(500);
}
void loop() {
servo.attach(servoPin);
servo.write(60);
delay(500);
servo.write(120);
delay(500);
servo.write(90);
servo.detach();
delay(500);
}