Hello, I have a circuit with encoder that sends data to serial port in format "value\n". The length of value is variable.
I want to read the value by ChibiOS serial.
What is the best approach?
I had a look on shell.c, maybe I could get inspired.
Thanks
Vaclav
How to parse data from sensor (UART)
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: How to parse data from sensor (UART)
Hi,
There are two UART drivers in HAL: the Serial driver and the UART driver, you need to use the Serial driver. In the shell you could take code from the function that reads the input line, it should be very simple, just remove the echo code if you don't need it.
Giovanni
There are two UART drivers in HAL: the Serial driver and the UART driver, you need to use the Serial driver. In the shell you could take code from the function that reads the input line, it should be very simple, just remove the echo code if you don't need it.
Giovanni