Sir,
We want to know about sample code of how to configure GPIO pins as output, and let we know how to include them for led toggling.
Sir,
We want to know about sample code of how to configure GPIO pins as output, and let we know how to include them for led toggling.
To configure a pin as output you just need to use (Assuming your LED is on pin 29)
#define LED_PIN 29
nrf_gpio_cfg_output(LED_PIN);// Set LED PIN pin as output
To set the pin to High , use
nrf_gpio_pin_set(LED_PIN);
to set the pin to low, use
nrf_gpio_pin_clear(LED_PIN);
to toggle the pin use
nrf_gpio_pin_toggle(LED_PIN);
Note. You need to include "nrf_gpio.h"
To configure a pin as output you just need to use (Assuming your LED is on pin 29)
#define LED_PIN 29
nrf_gpio_cfg_output(LED_PIN);// Set LED PIN pin as output
To set the pin to High , use
nrf_gpio_pin_set(LED_PIN);
to set the pin to low, use
nrf_gpio_pin_clear(LED_PIN);
to toggle the pin use
nrf_gpio_pin_toggle(LED_PIN);
Note. You need to include "nrf_gpio.h"
Thank you sir. And thanks for your valuable answer