Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TASK: Your task is to write code which handles a sequence of input characters from the UART interface, and responds with the output specified below.

TASK:
Your task is to write code which handles a sequence of input characters
from the UART interface, and responds with the output specified below.
On receipt of the character sequence:
- "foo" your program should print '0'.
- "bar" your program should print '1'.
- "foobar" your program should not print either '0' or '1' as specified
above, but should instead print a linefeed '
' character.
NOTE:
It is strongly recommended that you design a state machine to complete
this task.
Your solution should use a baud rate of 9600, and 8N1 frame format. Your
solution MUST NOT use qutyio.o or qutyserial.o.
EXAMPLES:
INPUT: ...foo.bar.foo.barfoobarfood
OUTPUT: 0101
0
(START)0101
0(END)
INPUT: barsfoosbarforbarfoobarrforfoobarfoobarfood
OUTPUT: 1011
0
(START)1011
0(END)
*/

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions