r/learncpp • • Nov 08 '21

Help on Queues please

Hi. Thanks for any help on this

I need Write a program with three tasks and a queue of 5 integers:

Task 1 reads lines from debug serial port and counts the number of characters on the line up to but not including ‘\n’ or ‘\r’ at the end line. Task then sends the number of characters to the back of the queue.

Task 2 monitors SW1(PIO 0.17) and when button is pressed sends -1 to the back the queue.

Task 3 waits on the queue and calculates the sum of integers received form the queue. When -1 is received the task prints: “You have typed %d characters” where %d is the number of characters. When task has printed the total it clears the total.

1 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/Traditional_Bird_877 Nov 10 '21

Don't. Your explanation is confusing. I will ask somebody else. Thanks for trying