Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo motor is not working with ESP32. #242

Closed
omkarshinde22 opened this issue Dec 17, 2021 · 3 comments
Closed

Servo motor is not working with ESP32. #242

omkarshinde22 opened this issue Dec 17, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@omkarshinde22
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Code:
#include "ESP32_Servo.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
int servoPin = 18;

void setup() {
Serial.begin(115200);
myservo.attach(servoPin); // attaches the servo on pin 18 to the servo object
// using default min/max of 1000us and 2000us
// different servos may require different min/max settings
// for an accurate 0 to 180 sweep

Serial.print("Connecting to ");

}

void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15);
Serial.print(pos); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Screenshot 2021-12-17 at 9 56 51 AM

@omkarshinde22 omkarshinde22 added the enhancement New feature or request label Dec 17, 2021
@urish
Copy link
Contributor

urish commented Dec 22, 2021

Thanks for the report! This is actually already covered by #214, and is open for voting

@urish urish closed this as completed Dec 22, 2021
@omkarshinde221
Copy link

omkarshinde221 commented Dec 23, 2021

Thanks for the response. Could we run esp32 and Arduino together? If yes please give one example, where esp32 and Arduino running on same template

Thanks

@urish
Copy link
Contributor

urish commented Dec 23, 2021

Could we run esp32 and Arduino together?

It should be possible once #186 is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants