We are using nRF52840DK development kit with nRF-Connect SDK to build a pre-production version of our product.
Thanks for the support in advance!
Samuel kapa
in #define OUTPUT_PIN 16.
what's 16 means
Hi Samuel,
It is P0.16. You can also use NRF_GPIO_PIN_MAP(port, pin) with the definition if you want to use a pin on port 1.
-Amanda H.
hi Amanda H,
here is the sample code i am writing for gpio.
#include <zephyr.h>
#include <device.h>
#include <sys/util.h>
#include <inttypes.h>
#include <devicetree.h>
#include <sys/printk.h>
#include <drivers/pwm.h>
#include <drivers/gpio.h>
#include <nrfx/hal/nrf_gpio.h>
//#define SLEEP_TIME_MS 3000
#define OUTPUT_PIN 15
void main(void)
{
nrf_gpio_cfg_output(OUTPUT_PIN);
while (1) {
nrf_gpio_pin_set(OUTPUT_PIN);
k_sleep(K_SECONDS(3U));
nrf_gpio_pin_clear(OUTPUT_PIN);
k_sleep(K_SECONDS(3U));
}
}
with is pin number 15 or 16, 13, 14. i am getting output.
but if i change the pin number to like 1 or 2. i am not getting any out put but it's uploading to board.
thanks,
samuel kapa.
Hi Samuel,
Please see the Connector interface of nRF52840DK. I don't think there is P0.02.
-Amanda H.
hi Amanda H,
thanks for u r help.
Glad to help.
-Amanda H.
Glad to help.
-Amanda H.