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

LED not blinking

for (int i = 0; i < LEDS_NUMBER; i++)
{
bsp_board_led_off(0);
nrf_delay_ms(500);
bsp_board_led_on(0);

}

in this code only the first command gets executed. 

It turns off and remains in that state, if bsp_board_led_off(0) is replaced with bsp_board_led_on(0), then it remains on. I tried with multiple bsp_board_led_invert(0); but still no success. it just executes the 1st time. Has been a recurring issue

Parents Reply
  • Have you used an oscilloscope or logic analyser to see what's happening on the pin?

    By "emulator" do you mean a pure software simulator, or a debug probe - such as a J-Link.

    Even with a pure software simulator, you should be able to single-step - and see what you're missing.

    But, In this day and age, there is really no reason not to be using a proper debugger with the debug facilities of the chip - even on Linux.

    Segger Embedded Studio (SES) runs on Windows, macOS, and Linux.

    EDIT

    try "unrolling" the loop ...

    ie, write out longhand the sequence of statements that actually gets executed

Children
No Data
Related