cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

New Contributor

#include "project.h"

#include <string.h>

char datorecibido;

CY_ISR(InterrupRX)

{

    datorecibido=UART_1_GetChar();

   

}

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

  UART_1_Start();

isrRX_StartEx(InterrupRX);

     for(;;)

        {

           if (datorecibido=='1')

                {

                    LED_Write(1);

                    UART_1_PutString("LED encendido \n");

                    CyDelay(500);

                   

                  

                }

             if (datorecibido=='0')

                {

                    LED_Write(0);

                    UART_1_PutString("LED apagado \n");

                    CyDelay(500);

                   

                }

        }

}

0 Likes
Reply
1 Solution
Honored Contributor II

ernesto-69,

use example below as example of receiving command string with value from terminal into circular buffer

UART string reception garbage value

/odissey1

View solution in original post

0 Likes
Reply
1 Reply
Honored Contributor II

ernesto-69,

use example below as example of receiving command string with value from terminal into circular buffer

UART string reception garbage value

/odissey1

View solution in original post

0 Likes
Reply