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

Switch servo not works #11

Open
TillMoss opened this issue Aug 31, 2022 · 5 comments
Open

Switch servo not works #11

TillMoss opened this issue Aug 31, 2022 · 5 comments

Comments

@TillMoss
Copy link

I have made this Useless-box but switch servo rotate only 45 degrees. If in config.h I change 145 with other value servo rotate always 45degrees

@Fullmetal11
Copy link

Same problem for me. Did you solve it?
Servo rotate max 90 degrees if i change 145 to 180 in config.h

@chips32
Copy link

chips32 commented Nov 10, 2022

I have the same problem. I am not an expert but I think it is do with the pulse width (in milliseconds) that is used for the servos.
I created a script to move the servo and found that I had to use the following for a full 180 movement.
void setup() {
myservo.attach(0, 500, 2500); //0.5ms 2.5ms
0=pin, 500=min pulse width, 2500=max pulse width (in micro seconds)
Now I just have to figure out how to do it with the code supplied.
Any ideas?

@Fullmetal11
Copy link

Unfortunately I don't know the programming language that well, however I have other sketches that move the same servo 180 degrees so I agree with you that it is definitely a code configuration problem, not an hardware problem.

@Doka85
Copy link

Doka85 commented Jan 9, 2023

Sorry for my bad english, but i think, the follow steps will solve your Problem @TillMoss and @Fullmetal11

you have to calibrate the min and max pulsewidth in servo.h, located in \AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\Servo\src\

#define DEFAULT_MIN_PULSE_WIDTH 1000 // uncalibrated default, the shortest duty cycle sent to a servo #define DEFAULT_MAX_PULSE_WIDTH 2000 // uncalibrated default, the longest duty cycle sent to a servo #define DEFAULT_NEUTRAL_PULSE_WIDTH 1500 // default duty cycle when servo is attached

in my case i have set to 500 and 2500, like @chips32

@Fullmetal11
Copy link

Fullmetal11 commented Jan 10, 2023

@Doka85 Thak you!!!

As you suggested, I change the value:

#define DEFAULT_MIN_PULSE_WIDTH 500 // uncalibrated default, the shortest duty cycle sent to a servo
#define DEFAULT_MAX_PULSE_WIDTH 2500 // uncalibrated default, the longest duty cycle sent to a servo

in the file servo.h located in \AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\Servo\src\ and I solved the problem, now it works good!!!!!
So happy now!!! :-)

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

No branches or pull requests

4 participants