Thingy 91 Blinky Example

So i purchased the thingy 91 eval board to try it out and see if it will be easy to work with.

I was able to follow the instructions and get vs code working properly and building, so i tried the blinky sample to see if I can blink the led light.

I managed to get it to build properly following the instructions and they explain how to flash it using the programmer in the nrf connect for desktop, it flashed properly and gave me the green progress saying it finished in 18 seconds.

I turn it off and on and I get nothing, no blinking light, no nothing.

Can someone please advise?

Parents
  • This tutorial assumes you are using a development board like the nRF52840 DK or nRF9160 DK, which define led0 and sw0 aliases in their devicetree. However, the Thingy:91 does not define led0.

    For Thingy91 use should use use the dk_buttons_and_leds.h library, which is specifically designed for the Thingy:91 and handles the LED and button.

    What worked for me:

    Modify main.c:

    Add

    #include <dk_buttons_and_leds.h>

    change main:
    int main(void)
    {
    int ret = dk_leds_init();
    if (ret != 0) {
    return ret;
    }

    while (1) {
    ret = gpio_pin_toggle_dt(&led);
    if (ret < 0) {
    return 0;
    }

    dk_set_led_on(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    dk_set_led_off(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    }
    return 0;
    }

    --- modify prj.conf

    CONFIG_GPIO=y
    CONFIG_DK_LIBRARY=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_BUILD_OUTPUT_BIN=y
    CONFIG_BUILD_OUTPUT_HEX=y
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_UART_CONSOLE=y

    --
    and use build/l1_e2/zephyr/zephyr.signed.hex
    as the file in Programmer.

    Unfortunately - a lot of changes in the first tutorial.

Reply
  • This tutorial assumes you are using a development board like the nRF52840 DK or nRF9160 DK, which define led0 and sw0 aliases in their devicetree. However, the Thingy:91 does not define led0.

    For Thingy91 use should use use the dk_buttons_and_leds.h library, which is specifically designed for the Thingy:91 and handles the LED and button.

    What worked for me:

    Modify main.c:

    Add

    #include <dk_buttons_and_leds.h>

    change main:
    int main(void)
    {
    int ret = dk_leds_init();
    if (ret != 0) {
    return ret;
    }

    while (1) {
    ret = gpio_pin_toggle_dt(&led);
    if (ret < 0) {
    return 0;
    }

    dk_set_led_on(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    dk_set_led_off(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    }
    return 0;
    }

    --- modify prj.conf

    CONFIG_GPIO=y
    CONFIG_DK_LIBRARY=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_BUILD_OUTPUT_BIN=y
    CONFIG_BUILD_OUTPUT_HEX=y
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_UART_CONSOLE=y

    --
    and use build/l1_e2/zephyr/zephyr.signed.hex
    as the file in Programmer.

    Unfortunately - a lot of changes in the first tutorial.

Children
No Data
Related