How to Send Hex string from uart to microcontroller and store it to integer for future "if" statement

uint8_t Values[4]={0};
uint8_t Loc=0;
uint32_t Mask=0xFF; //32 bits UART Rx Buffer size

for(uint8_t i=0;i<=24;i+=8)
{
 Values[Loc]=(((Mask<<i) & UartRxBuf) >> i);
 Loc++;
}

Leave a Comment