-
Notifications
You must be signed in to change notification settings - Fork 918
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
base: develop
Are you sure you want to change the base?
Conversation
uint32_t source_hz = clock_get_hz(clk_sys); | ||
uint freq = 50; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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??
if(wait_write) | ||
sleep_ms(1000); |
There was a problem hiding this comment.
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? 🤷
There was a problem hiding this comment.
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
Servo motor example
This example is an adapted version of the Micropython repository to be used easily in C.