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

Q5 Examine the program given in Listing Q5 and answer the following questions. ... 1: #include "mbed.h" 2: DigitalOut ledl (LEDI); 3: DigitalOut led2 (LED2); DigitalOut led3 (LED3); 5: Timeout Response; Timeout Response_duration; 7: Interruptin button (p5); 8: void blink_end (void); 9: void blink (void); 10: void ISRI (void); 11: void blink() { 12: led2=1; 13: Response_duration attach (sblink_end, 3.0); 14: 15: void blink_end() { 16: led2=0; 17: } 18: void ISRI () { 19: led3=1; 20: Response. attach (oblink, 2.0); 21: } 22: int main() { 23: button.rise (GISRI); 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) Q5 Examine the program given in Listing Q5 and answer the following questions. ... 1: #include "mbed.h" 2: DigitalOut ledl (LEDI); 3: DigitalOut led2 (LED2); DigitalOut led3 (LED3); 5: Timeout Response; Timeout Response_duration; 7: Interruptin button (p5); 8: void blink_end (void); 9: void blink (void); 10: void ISRI (void); 11: void blink() { 12: led2=1; 13: Response_duration attach (sblink_end, 3.0); 14: 15: void blink_end() { 16: led2=0; 17: } 18: void ISRI () { 19: led3=1; 20: Response. attach (oblink, 2.0); 21: } 22: int main() { 23: button.rise (GISRI); 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
Get step-by-step solutions from verified subject matter experts
