Skip to content

Add example for servo motor via PWM #140

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Skipper7718
Copy link
Contributor

Servo motor example

This example is an adapted version of the Micropython repository to be used easily in C.

@Skipper7718 Skipper7718 changed the title added servo example Add example for servo motor via PWM Jul 12, 2021
Comment on lines +36 to +37
uint32_t source_hz = clock_get_hz(clk_sys);
uint freq = 50;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation.

sleep_ms(1000);
}

void servo_init(int gpio, int base_frequency)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This base_frequency parameter doesn't seem to actually be used anywhere??

Comment on lines +25 to +26
if(wait_write)
sleep_ms(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is documented as "@param wait_write Wait for write to finish", in which case 1000ms seems like an excessively long time? 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My motors are slow and with a smaller delay my motor do not finish the turn properly

@kilograham kilograham added this to the 2.2.0 milestone Feb 13, 2025
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

Successfully merging this pull request may close these issues.

4 participants