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

nrf_gpio_pin_read() return always 0 with a GPIO as output

Hi all,

i need to read the status on my GPIO where there is a led.

I have configured it like a:

     nrf_drv_gpiote_out_config_t configLed = GPIOTE_CONFIG_OUT_SIMPLE(true);
      nrf_drv_gpiote_out_init(LED_2, &configLed);
      nrf_drv_gpiote_out_init(LED_1, &configLed);
      nrf_drv_gpiote_out_init(LED_3, &configLed);

but if i try to read the value with nrf_gpio_pin_read() return always 0.

What does it means "

 * @brief Function for reading the input level of a GPIO pin.
  Note that the pin must have input connected for the value
  returned from this function to be valid."
Parents Reply
  • I am not very into hardware, but that does not have any sense for me. How would you check if led is broken, by setting the state of the output to high, and later checking if it is really high? If you set it high, pin is high. But that does not mean led is ok or not ok. Maybe you could try measuring ex. if the current is drawn there, or by some photoresistor...

Children
No Data
Related