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

nRF 52 DK nrf_gpio_pin_read() always returning a 0 ?

Hi all,

I'm having an issue using the nrf_gpio_pin_read() function from the nrf_gpio.h file. When I call it every time after calling nrf_gpio_pin_toggle() on the same pin I am still always getting a 0 on my return. Any ideas as to why this is happening? Included code snippet below of usage.

nrf_gpio_pin_toggle(INDICATE_LED);
if(nrf_gpio_pin_read(INDICATE_LED)==0)
{
    for (uint32_t i = 0; i < length_on; i++)
    {
	    app_uart_put(L1ON[i]);
    }						
}
else  // NEVER GETTING IN HERE
{     // SHOULD BE WHEN PIN IS HIGH THOUGH
    for (uint32_t i = 0; i < length_off; i++)
    {
	    app_uart_put(L1OFF[i]);
    }
}

For clarification I am never making it into the else statement even though I should every other time the pin is toggled.

Any help would be appreciated, Thanks in advance!

Related