APP_PWM_INSTANCE(PWM1,1);
void PWM_init(void)
{
u32 err_code;
app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(1000, 8);
err_code = app_pwm_init(&PWM1,&pwm1_cfg,NULL);
APP_ERROR_CHECK(err_code);
app_pwm_enable(&PWM1);
while (app_pwm_channel_duty_set(&PWM1, 0, 0) == NRF_ERROR_BUSY);
}
void PWM_Set( u8 duty )
{
if ( duty>100 ) duty = 100;
while (app_pwm_channel_duty_set(&PWM1, 0, duty) == NRF_ERROR_BUSY);
}
hi,anybody! I have a issue When a device receives the bluetooth data will set the function PWM_Set() , duty take any value.