Skip to main content
Pooja WANI
Associate III
June 19, 2019
Question

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

  • June 19, 2019
  • 1 reply
  • 774 views

I am facing difficulty while getting hands on SPC5 Studio.

    This topic has been closed for replies.

    1 reply

    Pooja WANI
    Associate III
    June 24, 2019

    #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?