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.write(float) missing #44

Open
DieKatzchen opened this issue Mar 30, 2024 · 2 comments
Open

servo.write(float) missing #44

DieKatzchen opened this issue Mar 30, 2024 · 2 comments

Comments

@DieKatzchen
Copy link

servo.write(float) is missing. This breaks drop-in compatibility with other servo libraries. I have to do an #ifdef ESP32 for the #define <servo.h> and then another #ifdef ESP32 to have two versions of every servo.write() call. servo.write() should use the pin specified by servo.attach() if available.

@sturmfink
Copy link

As I understand this Library that is sadly not possible, because there is only one servo object which has multiple pins attached which are then again attached to different channels.

That's due to the general structure of the underlying ESP32 LEDC structure that is used in this library and the corresponding pam library.

I mean, of course it is possible, but as I believe it's not within the scope at the moment and would require a major rewrite.

@vegetarismus
Copy link

vegetarismus commented Nov 16, 2024

I have the same problem. After the update I can't compile my script.
This doesn't work anymore:
Servo::write(const byte&, int&, int&, int, int)'
pwm.write(sig2, duty, freq, 10, 512)

Because only this is in the new library:
float Servo::write(int, float)'
float write(int pin, float value)

Why is this function removed? Has the general structure of the library changed?

Is there an easy turnaround to make 2 signals with a specific frequency and duty and 50% phase shift?

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

3 participants