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

No change on P0.0 in SDK 16.0.0

Hi,

I tried controlling the LEDs connected to P0.0, P0.7 & P0.11 by using

nrf_gpio_cfg_output();
nrf_gpio_pin_set();

nrf_gpio_pin_clear();

& ble_app_blinky example code in SDK 16.0.0.

There was no change on LED connected to P0.0, can you tell me why?

Parents
  • Ok, the way I did it was:

    //For init
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
    
    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
        
    err_code = nrf_drv_gpiote_out_init(PIN_LED, &out_config);
    APP_ERROR_CHECK(err_code);
    
    //For changing states
    nrf_drv_gpiote_out_set(PIN_LED);
    
    nrf_drv_gpiote_out_clear(PIN_LED);

    Do let us know if it solves it.

    Edit_1: You would also need to add this library (this library provides a lot of functions regarding IOs including interrupts and all so I would recommend using this.

    #include "nrf_drv_gpiote.h"

Reply
  • Ok, the way I did it was:

    //For init
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
    
    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
        
    err_code = nrf_drv_gpiote_out_init(PIN_LED, &out_config);
    APP_ERROR_CHECK(err_code);
    
    //For changing states
    nrf_drv_gpiote_out_set(PIN_LED);
    
    nrf_drv_gpiote_out_clear(PIN_LED);

    Do let us know if it solves it.

    Edit_1: You would also need to add this library (this library provides a lot of functions regarding IOs including interrupts and all so I would recommend using this.

    #include "nrf_drv_gpiote.h"

Children
Related