Hi! I’m trying to control a countinuous servo (FEETECH FS90R) with the XIAO ESP32S3.
The wiring is simply GND to servo -, 3.3v to servo +, D10 / GPIO9 to servo pwm. Convenient because it’s aligned with the servo connector.
This particular servo works without issues on an Arduino UNO board (on 3.3v too), but I can’t make it to work on the XIAO ESP32S3.
I tried the ESP32 Servo library with the following code :
#include <ESP32Servo.h>
Servo servo;
void setup() {
servo.attach(9);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
servo.write(700);
delay(2000);
digitalWrite(LED_BUILTIN, LOW);
servo.write(1500);
delay(2000);
digitalWrite(LED_BUILTIN, HIGH);
servo.write(2300);
delay(2000);
digitalWrite(LED_BUILTIN, LOW);
servo.write(1500);
delay(2000);
}
And the ESP32 PWM, Servo, Easing and Tone Library with the following code:
#include <Servo.h>
Servo servo = Servo();
int pin = 9;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
servo.write(pin, 700);
delay(2000);
digitalWrite(LED_BUILTIN, LOW);
servo.write(pin, 1500);
delay(2000);
digitalWrite(LED_BUILTIN, HIGH);
servo.write(pin, 2300);
delay(2000);
digitalWrite(LED_BUILTIN, LOW);
servo.write(pin, 1500);
delay(2000);
}
But nothing happens, am I missing something?
I tried another GPIO, and powering it from the 5v output but no luck.
Thanks for your help.