NordicDeveloperAcademy / ncs-inter

15 stars 10 forks source link

LED doesn't blink in Lesson 4 - Exercise 2 #10

Open olalonde opened 2 months ago

olalonde commented 2 months ago

https://github.com/NordicDeveloperAcademy/ncs-inter/tree/main/lesson4/inter_less4_exer2_solution

Tested with nrf52840dk. The buttons do activate the motor but the LEDs remain turned off.

olalonde commented 2 months ago

It seems it should be (pin p0.13 and not p0.10):

/* STEP 1.4 - Configure which pins your custom pwm0 instance should use */
&pinctrl {
    pwm0_custom: pwm0_custom {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 13)>;
            nordic,invert;
        };
    };

    pwm0_csleep: pwm0_csleep {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 13)>;
            low-power-enable;
        };
    };
};

But the solution/devacademy exercise steps use:

&pinctrl {
    pwm0_custom: pwm0_custom {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 10)>;
            nordic,invert;
        };
    };

    pwm0_csleep: pwm0_csleep {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 10)>;
            low-power-enable;
        };
    };
};