cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone please share an example like blinking an LED using SPC560B54L5 in SPC5 Studio?

Pooja WANI
Associate II

I am facing difficulty while getting hands on SPC5 Studio.

1 REPLY 1
Pooja WANI
Associate II

#include "components.h"

#define PIN_Out2 116

#define PIN_Out1 117

void blink_delay(int n);

/*

 * Application entry point.

 */

int main(void) {

 /* Initialization of all the imported components in the order specified in

   the application wizard. The function is generated automatically.*/

 componentsInit();

 /* Application main loop.*/

 for ( ; ; ) {

 pal_setpad(PORT_C, PIN_Out1);

 pal_setpad(PORT_C, PIN_Out2);

 blink_delay(500);

 pal_clearpad(PORT_C, PIN_Out1);

 pal_clearpad(PORT_C, PIN_Out2);

 blink_delay(500);

 pal_setpad(PORT_C, PIN_Out1);

 pal_setpad(PORT_C, PIN_Out2);*/

 pal_togglepad(PORT_C, PIN_Out1);

 pal_togglepad(PORT_C, PIN_Out2);

 }

}

void blink_delay(int n) {

int i,j;

for(i=0; i<n; i++) {

for(j=0; j<100; j++) {

;

}

}

}

What is wrong in this code?