Can't make a servo to work on the XIAO ESP32S3

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.

Hi there,
try pin (2) D1, GPIO 2
Whoa, AFAIK the most they can sync is 45.ma for the GPIO’s for ESP32’s
Can you try it with JUST the PIN number of the Xiao also, which BSP package are you using?
First & 2nd line of the compiler output?
LMK
HTH
GL :slight_smile: PJ :v:

Note; on Servo LIB
All pin numbers are allowed,
but only pins 2,4,12-19,21-23,25-27,32-33 are recommended.