diff --git a/main.c b/main.c index a1c914e..56a9874 100644 --- a/main.c +++ b/main.c @@ -50,6 +50,32 @@ char UART1_READ(void) // UART1 READ DATA return (char)UART1_DR_R; // RETURN RECEIVED DATA } +void UART1_RXTX_to_DISPLAY(char RX_DATA) +{ + if (RX_DATA == 0x52) + { + GPIO_PORTF_DATA_R |= 0x02; // IF RECEIVED CHARACTER IS R TURN ON RED LED + + + } + else if (RX_DATA == 0x42) + { + GPIO_PORTF_DATA_R |= 0x04; // IF RECEIVED CHARACTER IS B TURN ON BLUE LED + + + } + else if (RX_DATA == 0x47) + { + GPIO_PORTF_DATA_R |= 0x08; // IF RECEIVED CHARACTER IS G TURN ON GREEN LED + + } + else + { + GPIO_PORTF_DATA_R &= 0x00; // RED LED FOR JUNK DATA + } + +} + int main(void) // MAIN FUNCTION