Question: 2 ) ( 2 5 points ) The door in the doorway egress problem can allow three robots at a time to exit. In the

2)(25 points) The door in the doorway egress problem can allow three robots at a time to exit. In the algorithm, robots arrange themselves so that each has a clear path to the door, and they then exit three at a time, with the three closest robots exiting simultaneously. Each robot must determine if it is among the three to exit. Construct a Cortex-M4 assembly program for a robot \( r \) to do the following. Robot \( r \) holds an array distance with the distance of each other robot to the center of the door. Let robots_seen hold the number of other robots. Variable own_distance holds the distance from \( r \) to the center of the door. Determine if \( r \) is one of the three closest robots. If so, set variable exit to 1 ; otherwise, set exit to 0.(Note: Each distance is an unsigned integer. We could instead consider each distance as a Q5 number, but that would not change the program.). You can assume that no two distances are the same.
Demonstrate your results to the lab TA.
```
Sample results for Part 2- For the following inputs:
distance =78,291,12,466,280
robots_seen =5
own_distance =501
the following output is produced:
exit =0
(If own_distance =101, then exit =1.)
```
2 ) ( 2 5 points ) The door in the doorway egress

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!