Hi, i have an esp32 that i'm trying to program in arduino ide at first i was getting errors then i downloaded esp32servo library and the code compiled and uploaded perfectly. Now my problem is the esp32 led light is red when the code is uploaded it didn't flash blue even if i clicked the boot button. And when i connect everything the servo isn't moving. The servo is working fine since i tested it on arduino and all the cables are working fine .Thats the code:
#include <ESP32Servo.h>
Servo myServo;
int servoPin = 18;
void setup() {
// put your setup code here, to run once:
myServo.attach(servoPin);
}
void loop() {
// move the servo motor from 0 degrees to 180 degrees
for (int i = 0; i <= 180; i++) {
myServo.write(i);
delay(100);
}
// move the servo motor from 180 degrees to 0 degrees
for (int i = 180; i >= 0; i--) {
myServo.write(i);
delay(100);
}
}
If someone knows what could be the problem thank you
The code is compiling and uploading but its not working
-
- Posts: 1
- Joined: Thu Aug 31, 2023 1:48 pm
The code is compiling and uploading but its not working
Last edited by joe mfawad on Thu Aug 31, 2023 6:21 pm, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 97 guests