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

how to blink led using gpio of nrf51422 dk?

please provide code for blinking led using gpio of nrf51422 dk

  • The "experimental ble app blinky" example in the SDK shows how to toggle the LED with a button press.

    Or, if you are connecting an LED/resistor to an arbitrary GPIO:

    uint8_t led_out = 0;  // led value
    uint8_t led_pin = 23;  // led gpio pin number
    
    rf_gpio_cfg_output(led_pin);
    while(true)
    {
          nrf_gpio_pin_set(led_pin);
         nrf_delay_ms(100);
         nrf_gpio_pin_clear(led_pin);
         nrf_delay_ms(100);
    }
    
Related