Page 1 of 1

How to parse data from sensor (UART)

Posted: Fri Mar 15, 2019 2:55 pm
by mravenca
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

Re: How to parse data from sensor (UART)

Posted: Fri Mar 15, 2019 5:26 pm
by Giovanni
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