This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

LED blink control

Hi,

I noticed that there are a few methods in nRF52 SDK v16 to blink LEDs:

  • Use bsp indication methods which seems based on app_timer;
  • Use led_softblink library which based on app_timer and low power pwm;
  • Use nrf_gpio_pin_set or clear to control LEDs;

I am wondering which is better?

My use case is to use LED indicate various running status defined by my app, the status is not same as those bsp led indicate since I don't want distinguish low level BLE status.

Currently I am using led soft blink library but I found I can't fully control the effects. I am only using one LED and trying to use different on/off cycles for different status. So I initialize and started the soft blinker once and upon each status change, I use led_softblink_off_time_set() and led_softblink_on_time_set() to adjust the on/off cycles.

I am using the following values: 

  • State 1: on=500ms, off=500ms;
  • State 2: on=500ms, off=1500ms;
  • State 3: on=500ms. off=4500ms;

I am expecting the blinking frequency for state1 is 1hz, for state2 is 0.5hz, and for state 3 is 0.2hz. But I am unsure if this arrangement is obvious or not.

Meanwhile, I can't feel too much differences if I use 250ms for State1.

Regards,

yf13

Related