nrf52840 dongle PCA10059 GPIO Out LED

I am trying to get an LED attached to GPIO to turn on. I have tried all documented methods I could find but with no success. I have no issue controlling the onboard LEDS but I cannot seem to configure a GPIO as an output. I also have no issue configuring a GPIO as an input. The LED 100% works as it lights if attached to VDD pin or when connected to a GPIO pin set as an input. My wiring for the LED is between the GND and GPIO pin (0.2) and i have tried using both set and clear but with no result. Any ideas would be greatly appreciated.

Parents
  • Hi,

    Which method did you try, and which pin have you conneced the LED to? Also, which SDK are you using?

    The simplest way to control a GPIO (which control the LED) is to just set it directly using nrf_gpio_pin_set() and nrf_gpio_pin_clear() with the pin number as parameter. For that you need "#include <hal/nrf_gpio.h>", and you need to first configure the pin as output using nrf_gpio_cfg_output(), with the pin number as parameter here as well.

Reply
  • Hi,

    Which method did you try, and which pin have you conneced the LED to? Also, which SDK are you using?

    The simplest way to control a GPIO (which control the LED) is to just set it directly using nrf_gpio_pin_set() and nrf_gpio_pin_clear() with the pin number as parameter. For that you need "#include <hal/nrf_gpio.h>", and you need to first configure the pin as output using nrf_gpio_cfg_output(), with the pin number as parameter here as well.

Children
Related