Hello.
An LED is connected to the pin of my nRF52832 through a resistor to ground. How can you programmatically determine its presence? I tried to do pullup and read the port with and without LED connected, but in both cases it was getting false.
Hello.
An LED is connected to the pin of my nRF52832 through a resistor to ground. How can you programmatically determine its presence? I tried to do pullup and read the port with and without LED connected, but in both cases it was getting false.
Hi,
Did you configure the pin as input? Usually when an LED is connected, it is configured as output. This could be an issue. If this is done, then if you connect a pullup to the LED, then you should get 1.
Regards,
Priyanka
Hi,
Did you configure the pin as input? Usually when an LED is connected, it is configured as output. This could be an issue. If this is done, then if you connect a pullup to the LED, then you should get 1.
Regards,
Priyanka
If I configure as an input with NRF_GPIO_PIN_PULLUP then I get true in both cases (with and without LED).
In the end, I still found a way out. You need to turn off the tightening and wait a while. The code is like this:
nrf_gpio_cfg_input(LED_PIN2, NRF_GPIO_PIN_PULLUP); nrf_delay_us(30); nrf_gpio_cfg_input(LED_PIN2, NRF_GPIO_PIN_NOPULL); nrf_delay_ms(30);
the second delay must be selected depending on the resistance with the led
Hi,
Glad that you got it working! Happy Holidays!
Regards,
Priyanka