Hi
I am looking for some example code that shows best how to talk to a servo.. If there isn't any, any ideas which example project comes the closest ?
Thanks
J
Hi
I am looking for some example code that shows best how to talk to a servo.. If there isn't any, any ideas which example project comes the closest ?
Thanks
J
Hi,
These servos are controlled by sending a Pulse width Modulation (PWM) signal. For the nRF51 the best starting point will be the PWM Library Example. It’s located in the folder
<SDK_InstallFolder>\examples\peripheral\pwm_library
Try with a period of 20000L, and set the duty cycle to 5% and 10% for min and max servo position.
Code snippets:
app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(20000L, PWM_PIN);
while (app_pwm_channel_duty_set(&PWM1, 0, 10) == NRF_ERROR_BUSY);
Thank you.
Thank you.