E
E
eegmak2021-03-05 15:13:26
STM
eegmak, 2021-03-05 15:13:26

How to implement string expectation by uart?

For example, I send "led on" to uart, which starts subroutine 1 and "led off", which starts subroutine 2. Also, other commands or noise can come to uart that do not need to be processed, how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-03-05
@vabka

1. There should be no noise in the UART. This is a digital protocol.
2. You configure uart
3. You read data from the stream via read! and readln!
4. Decode the data
5. Through if or match you choose what to do

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question