2024-03-22 12:25 AM
i am trying to connect "RFID YHY502CTG" with STM32F407G-DISC1,i have attached the datasheet of RFID,please help me to send and receive data. i am using this code in while loop.
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
Txdata[0]=0xAA;
Txdata[1]=0xBB;
Txdata[2]=0x02;
Txdata[3]=0x01;
Txdata[4]=0x03;
HAL_UART_Transmit(&huart1, Txdata, sizeof(Txdata),100);
HAL_UART_Receive(&huart1, Rxdata, sizeof(Rxdata),100);
}
i have intialized these two buffers
uint8_t Txdata[5];
uint8_t Rxdata[20];