Hello everyone. I would like to thank everyone who had previously assisted me with getting a traditional 180 servo to work.
This time, I'm working with 360 continuous servos for a different task, and once again I'm using an ESP32.
I have familiarized myself with how continuous servos work, and the different signals they have, however, it appears there are great differences with the ESP32. When I upload my code, the motor receives power (it is much stiffer when the circuit is active), but it simply does not rotate at all.
I've looked around and there appears to not be many libraries or documentation on how to make this servo work, through I've noted fellow who has it figured out:
I even made a servo rotate for ~ 4 seconds while building and wiring up parts of the projection im building, though I have never been able to replicate this ever again.
My code:
#include <ESP32Servo.h>
Servo myservo; // create servo object to control a servo
// 16 servo objects can be created on the ESP32
int pos = 0; // variable to store the servo position
// Recommended PWM GPIO pins on the ESP32 include 2,4,12-19,21-23,25-27,32-33
// Possible PWM GPIO pins on the ESP32-S2: 0(used by on-board button),1-17,18(used by on-board LED),19-21,26,33-42
// Possible PWM GPIO pins on the ESP32-S3: 0(used by on-board button),1-21,35-45,47,48(used by on-board LED)
// Possible PWM GPIO pins on the ESP32-C3: 0(used by on-board button),1-7,8(used by on-board LED),9-10,18-21
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)
int servoPin = 2;
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
int servoPin = 2;
#else
int servoPin = 2;
#endif
void setup() {
// Allow allocation of all timers
ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
myservo.setPeriodHertz(50); // standard 50 hz servo
myservo.attach(servoPin); // attaches the servo on pin 2 to the servo object
myservo.write(180); // AS A CONTINUOUS SERVO, THIS SHOULD ROTATE CONTINUOUSLY AT MAX POWER
}
The wiring is good, otherwise, need assistance with this code.