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

How to use the GPIO for switching purpose?

#include "nrf.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"

#define LED1_PIN  P0.17 

int main (void)
{
   nrf_gpio_cfg_output(LED1_PIN);
   nrf_gpio_pin_set(LED1_PIN, 1);
}

I wanted pin 17 to be high so as to switch on a relay based circuit!

Related