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

Get the output level of servo pin #46

Open
ArminJo opened this issue Feb 18, 2024 · 0 comments
Open

Get the output level of servo pin #46

ArminJo opened this issue Feb 18, 2024 · 0 comments

Comments

@ArminJo
Copy link

ArminJo commented Feb 18, 2024

Hi,
since you did not enable discussions (Settings > Features > Discussions) I have to enter my question as an issue.

I want to solve the problem, that the servo signal goes LOW at the time of detach() see output below.

Is there a way to get the current state of the I/O pin used for servo output.
On AVR platform I can use digitalRead(<pin_number>) but on ESP32, this does not work, it stops the program.

If I connect the pin to another and use the othes as input the program works well and output:

Attach servo at pin 5 and move to 0 -> 180 -> 90 degree
Connect servo out pin 5 to monitoring in pin=18
Each character is 50 microseconds
Move servo to 180 degree, wait 400 ms and then detach 600 microseconds after start of pulse
_------------___________________________________________
Move servo to 180 degree, wait 400 ms and then detach 2500 microseconds after start of pulse
_-----------------------------------____________________

Or is there a way to read out the timer counter value and to decide if it is lower than hpoint, which I can get with
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#_CPPv415ledc_get_hpoint11ledc_mode_t14ledc_channel_t ?

Thanks
ArminJo

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

1 participant