Skip to main content
VSelv.11
Associate
Oct 23, 2020 7:20 AM UTC
Solved

Hi, I'm new to this SPC582BX. how to make LED blink with different delays? i used pal_lld_setpad and clearpad with delay. but board its continuous glow only. all files are added from component.h file. but still not work

..

    This topic has been closed for replies.
    Giuseppe DI-GIORE
    ST Employee
    Nov 2, 2020 11:47 AM UTC

    Hello,

    In SPC5Studio there are several applications with do LED blinking.

    However in order to do LED blinking please see the code below

    Pin connected to LED has to be configured as GPIO push-pull

    /* Enable the interrupts */

     irqIsrEnable();

    for ( ; ; ) {

    pal_togglepad(<your port>, <your pin>);

    osalThreadDelayMicroseconds(<milliseconds>);

    }

    Regards,

    Giuseppe

    2 replies

    Giuseppe DI-GIORE
    ST Employee
    Nov 2, 2020 11:47 AM UTC

    Hello,

    In SPC5Studio there are several applications with do LED blinking.

    However in order to do LED blinking please see the code below

    Pin connected to LED has to be configured as GPIO push-pull

    /* Enable the interrupts */

     irqIsrEnable();

    for ( ; ; ) {

    pal_togglepad(<your port>, <your pin>);

    osalThreadDelayMicroseconds(<milliseconds>);

    }

    Regards,

    Giuseppe

    VSelv.11
    VSelv.11Author
    Associate
    Nov 3, 2020 4:08 AM UTC

    Hi,

    It works. Thanks Giuseppe

    Regards,

    Rocky