2022-11-18 01:16 AM
Hi,
I am working on stm32f051c8t6tr microcontroller, from this I want to read some sensor data with UART1 and same data I want to transmit to another UART. Can you please suggest some example code related to my task. I am new to this controller.
I have tried one code also but its not working, I will share the code in below
HAL_UART_Receive(&huart1,(uint8_t *)buffer,10,10);
HAL_UART_Transmit(&huart2,(uint8_t *)buffer,10,10);
The above two line of code only I tried, buts its not giving any output; Please help me on this.
2022-11-21 10:38 AM
First test your sensor with bluetooth HC-05 or similar from a pc.
If this passes, implement a sw fifo tx and rx between both uart to be clean. Use byte uart interrupt. Gas sensor are usually slow response time, high bitrate probably not needed.