I have a ESP32-C3 super mini board where i cannot get any servosignal to run.
With the following code i can produce a pwm Signal with 1kHz as it should be (measured with oszilloskop). So the hardware is ok.
void setup() {
// put your setup code here, to run once:
pinMode(2,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(2,90); // Creates an PWM Signal with 1kHz on PIN 2 as it should do.
delay(200);
}
As soon as i want to use a Servo library i do not get any pin to provide a servo signal.
Yeah it is working with the library hallowed31 suggested. i also missed to check the compatibility list. i only searched for a library for the ESP32 processor. The fact that a library is suitable for the ESP32 processor but not for my specific board is a little bit confusing for me.
Thank you very much for your help. Now i can step deeper into the prgramming of my servo control.
i searched in the arduino IDE for an servo library and ESP32 processor. What i got was the SimpleServoESP32 library from noeFly where the Servo.h is included. Thats why i assumed it should be ok for my board including the ESP32 processor.
A servo signal frequency should be 50Hz, not 1KHz.
With a very short "HIGH" time of 1-2ms.
Best to use a library for that.
Make sure you connect servo ground to supply ground and ESP ground.
Servos draw a high peak current every time they move.
About 650mA for the tiny SG90 and 2.5Amp for larger ones.
Therefore it's always better to give them their own supply, rated for at least that current.
Leo..