led 1 is off but p0.13 get 3v output , similarly led 1 is on p0.13 get 0v output, how to change it help me. similar for led 1 to led 4 respectively p0.13 to p0.16.
led 1 is off but p0.13 get 3v output , similarly led 1 is on p0.13 get 0v output, how to change it help me. similar for led 1 to led 4 respectively p0.13 to p0.16.
Hi,
This is as expected, since the LEDs are active low. See this link:
https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/hw_buttons_leds.html
I don't get it, sir is there any change in the program because in nrf mesh application when we will click the generic on button then led will glow but the respective GPIO pin like p0.13 to p0.16 will get 0v output similarly when we will click the generic off button then led will not glow but respective GPIO pins like p0.13 to p0.16 get output voltage 3v.
I want when I will click off button in nrf mesh app then led will be off and gpio pins p0.13 get 0v output, i am doing this in switch light example.
help me thank you
Hi,
As mentioned in the other case you created, whether LEDs are active low or not depends on the HW design of your board. It's active low on the Nordic kits, and that's not something you can change with SW.
As seen in the Nordic DK schematic,

If you set the GPIO to low, then the current will flow from VDD, through the LED, and into the nRF52.
If you set the GPIO to high(VDD), then voltage on both sides of the LED will be VDD, and the LED will not glow.
thank you so much, can you please tell how would I set GPIO to low. suppose i want to set GPIO Pin0.13 as low. What should I do now. in switch example or CTL light example.
can I do this by any change in software.
thank you so much, can you please tell how would I set GPIO to low. suppose i want to set GPIO Pin0.13 as low. What should I do now. in switch example or CTL light example.
can I do this by any change in software.
In nRF5 SDK for Mesh, the examples uses the simle_hal.c for this functionality. You can use the hal_led_pin_set() function to set the LED on or off.
/** * Sets the LED for the given PIN. * @param[in] pin LED pin number. * @param[in] value @c true for on, @c false for off. */ void hal_led_pin_set(uint32_t pin, bool value);
doubt1- simle_hal.c is only in switch example, its not in ctl and dimming example.
doubt2- my question was how can i set gpio pin low. because whenever we load program of ctl or dimming respective gpio pin gets 3v even leds not glow , i want to set this zero please help me out.
thank you so much and please reply fast.
please reply
please reply
Brainson said:leds not glow
Advised to use a transistor: https://devzone.nordicsemi.com/f/nordic-q-a/72305/not-able-to-get-output-as-expected-on-gpio-port-on-board-nrf52840-dk