cancel
Showing results for 
Search instead for 
Did you mean: 

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

VSelv.11
Associate
 
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Giuseppe DI-GIORE
ST Employee

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

View solution in original post

2 REPLIES 2
Giuseppe DI-GIORE
ST Employee

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
Associate

Hi,

It works. Thanks Giuseppe

Regards,

Rocky