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

Issue with clearing leds

I am writing a code to blink the LEDS , the 3rd one is not turning off.

Here is the code-

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
#include "bsp.h"
#include "system_nrf52.h"

/**
* @brief Function for application main entry.
*/

#define LED1 BSP_LED_0
#define LED2 BSP_LED_1
#define LED3 BSP_LED_2
#define LED4 BSP_LED_3
#define BTN ARDUINO_9_PIN


int main(void)
{
/* Configure board. */
bsp_board_init(BSP_INIT_LEDS);

/* Toggle LEDs. */
while (true)
{

nrf_gpio_pin_clear(LED1);


nrf_gpio_pin_clear(LED2);



nrf_gpio_pin_clear(LED3);

nrf_delay_ms(3500);

nrf_gpio_pin_set(LED1);

nrf_delay_ms(3500);

nrf_gpio_pin_set(LED2);

nrf_delay_ms(3500);

nrf_gpio_pin_set(LED3);


}
}

The last LED to turn of, doesn't, I want to know why and how to turn it off?

Related