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

external GPIO is not working

Hello,

   I wrote a simple program to turn on externally connected LED at Port 1 and Pin 10. But it is not working. See the code - 

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

#define LED3_W NRF_GPIO_PIN_MAP(1,10)   //Define 
/**
* @brief Function for application main entry.
*/
int main(void)
{
/* Configure board. */
bsp_board_init(BSP_INIT_LEDS);

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

bsp_board_led_on(LED3_W);

}
}

/**
*@}
**/

          waiting for a quick response 

Parents
  • Get the right code (forget to define Pin as output and Pin set). Here - 

    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf_delay.h"
    #include "boards.h"
    #include "nrf_gpio.h"

    #define LED3_W NRF_GPIO_PIN_MAP(1,10)
    /**
    * @brief Function for application main entry.
    */
    int main(void)
    {
    /* Configure board. */
    bsp_board_init(BSP_INIT_LEDS);
    nrf_gpio_cfg_output(LED3_W);
    /* Toggle LEDs. */
    while (true)
    {

    nrf_gpio_pin_set(LED3_W);


    }
    }

Reply
  • Get the right code (forget to define Pin as output and Pin set). Here - 

    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf_delay.h"
    #include "boards.h"
    #include "nrf_gpio.h"

    #define LED3_W NRF_GPIO_PIN_MAP(1,10)
    /**
    * @brief Function for application main entry.
    */
    int main(void)
    {
    /* Configure board. */
    bsp_board_init(BSP_INIT_LEDS);
    nrf_gpio_cfg_output(LED3_W);
    /* Toggle LEDs. */
    while (true)
    {

    nrf_gpio_pin_set(LED3_W);


    }
    }

Children
Related