-
Notifications
You must be signed in to change notification settings - Fork 1
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 movement #8
Comments
Is it by design? Sounds like a pulse width/timing issue. I assume you are referring to the Arduino servo example? On my ESP8266 CLB V1.0.0.91 servo works and just flashed and tested V1.1.0.0 - is your servo broke? |
I've tried a couple of different servos and they all perform the same way. They move 180 degrees on the Arduino example and 90 degrees in the CLB. I've tried the Arduino code in the CLB code and it goes wrong, so I'm thinking I might be running ESP32 servo driver code on the ESP8266 for some reason. You might not be seeing this because I think (although I may be wrong) that you are building your code from scratch and might have the libraries installed properly. I'm going to wire up an ESP32 and have a play. I'm also going to make a brand new "empty" install by cloning the CLB code into a new folder and building from that. |
Yep, I build my code from scratch. Every time. |
On my NodeMCU (ESP32) the servo works fine using V1.0.0.95 and V1.1.0.0 - though its more like 170 degrees. |
I've just tested the code on an ESP32 and it works fine. It looks like they have changed the limits for the ESP8266 servo movement. It's mentioned here: esp8266/Arduino#8081 |
Yep. It's all down to this: esp8266/Arduino#7023 I'd rather have the range of movement and run the risk of damage than restrict useful behaviour. I've changed the defaults back to the original ones so that ESP8266 and ESP32 now move in the same range. Fixed. |
@CrazyRobMiles It seems from your post that your fix involved modifying the core sources, that's not what's needed. I hope you would agree that preventing damage first, then simply specifying the extended range for a given servo suits everyone.
This is safe for everyone and allows you to set the exact timings for each of your servos. |
@dok-net thanks for your interest. I actually did exactly what you've suggested but my post of "Fixed" didn't make that very clear. There are a couple of constants in servo.h:
These are used in the attach in servo.cpp in the call of attach:
I wondered about making these configurable settings (like the output pin) but at the moment they are baked into the code. |
@CrazyRobMiles I can't follow your reasoning. The defaults are defined in the code, naturally. Once you by trial-and-error determine the correct limits for your particular servo, you use them in your call to |
@dok-net Hi. Sorry for causing more confusion. I'm talking about my code, not the library. I'm making a device which is software configurable. I've put some fixed values in my code at the moment (the defines that you can see in my file servo.h) with the intention of making them user configurable later (if people ask for it). Then the user can determine the min and max they want to use for their particular servo and configure them in the settings for that device. I've not changed the Arduino servo library at all and I don't intend to. |
The servo is only moving through half its range when on a Connected Little Box.
The ESP8266 servo example works fine, but when the same code runs inside the CLB software it only moves the servo through half its range. This is a new behaviour that has appeared recently.
The text was updated successfully, but these errors were encountered: