Question: Q5 Examine the program given in Listing Q5 and answer the following questions. 1: #include mbed.h 2: DigitalOut ledi (LEDI); 3: Digitalout led2 (LED2); 4:

 Q5 Examine the program given in Listing Q5 and answer the

Q5 Examine the program given in Listing Q5 and answer the following questions. 1: #include "mbed.h" 2: DigitalOut ledi (LEDI); 3: Digitalout led2 (LED2); 4: Digitalout led3 (LED3); 5: Timeout Response; 6: Timeout Response_duration; 7: InterruptIn button (p5); 8: void blink_end (void); 9: void blink (void); 10: void ISR1 (void); 11: void blink() { 12: led2=1; 13: Response_duration.attach(&blink_end, 3.0); 14: } 15: void blink_end() { 16: led2=0; 17: } 18: void ISR1() { 19: led3=1; 20: Response.attach (&blink, 2.0); 21: } 22: int main() { 23: button.rise (&ISR1); 24: while (1) { 25: led3=0; 26: ledl=!ledl; 27: wait (0.2); 28: } 29:} Listing Q5 (a) Determine the features that being integrated in Listing Q5 to increase the efficiency of processor in performing a task. (2 marks) (b) Analyze the Listing Q5 and explain its operation. (4 marks) (c) Sketch flowchart to conceptualize the operation of Listing Q5. (4 marks)

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 Databases Questions!