I changed seqValues variable of the following function from 0x8000 to 0x0010. But I can't see LED light darkening. How to dim LED lights by nRF52832 PWM?
static void _ledPwmConfig(const uint8_t pin) {
nrf_drv_pwm_config_t const config0 =
{
.output_pins =
{
pin | NRF_DRV_PWM_PIN_INVERTED, // channel 0
NRF_DRV_PWM_PIN_NOT_USED, // channel 1
NRF_DRV_PWM_PIN_NOT_USED, // channel 2
NRF_DRV_PWM_PIN_NOT_USED, // channel 3
},
.irq_priority = APP_IRQ_PRIORITY_LOWEST,
.base_clock = NRF_PWM_CLK_125kHz,
.count_mode = NRF_PWM_MODE_UP,
.top_value = 25000,
.load_mode = NRF_PWM_LOAD_COMMON,
.step_mode = NRF_PWM_STEP_AUTO
};
APP_ERROR_CHECK(nrf_drv_pwm_init(&_gPwm0, &config0, NULL));
_gPwmUsed |= USED_PWM(0);
// This array cannot be allocated on stack (hence "static") and it must
// be in RAM (hence no "const", though its content is not changed).
static uint16_t /*const*/ seqValues[] =
{
0x0010
};
nrf_pwm_sequence_t const seq =
{
.values.p_common = seqValues,
.length = NRF_PWM_VALUES_LENGTH(seqValues),
.repeats = 0,
.end_delay = 4
};
nrf_drv_pwm_simple_playback(&_gPwm0, &seq, 3, NRF_DRV_PWM_FLAG_STOP);
}