Question: Q5 Timing Considerations 20 Points A B 1 0 1 2 2 3 4 4 5 In the timing figure above, the rectangles represent tasks




Q5 Timing Considerations 20 Points A B 1 0 1 2 2 3 4 4 5 In the timing figure above, the rectangles represent tasks executing (the // de processing in the code examples below). For each code example, identify the type of timing (e. whether it is blocking or non-blocking), and which timing diagram the code corresponds to. Q5.1 2 Points In the following code, what type of timing is this? const unsigned long deltaTime = 1000: unsigned long next Time = 0; void setup() { } void loop() { if (aillis() >= nextTime) { nextTime += deltaTime: 1/ do processing } } Delta timing (non-blocking) Delay or equivalent (blocking) Save Answer Q5.2 2 Points Which timing diagram does this correspond to? OA OB Q5.3 2 Points In the following code, what type of timing is this? conet unsigned long deltaTime - 1000: unsigned long nextTins - 0: void setup() { } void loop() { unsigned long current Time - millis(); if (current Time >= nextTime) { nextTime - current Time + deltaTime: 11 do processing 1 } O Delta timing (non-blocking) O Delay or equivalent (blocking) Save Answer Q5.4 2 Points Which timing diagram does this correspond to? OB Save Answer Q5.5 2 Points In the following code, what type of timing is this? void setup() { } void loop() { // do loop processing delay(1000): } O Delta timing (non-blocking) O Delay or equivalent (blocking) Q5.6 2 Points Which timing diagram does this correspond to? OB Save Answer Q5.7 2 Points In the following code, what type of timing is this? const unsigned long deltaTime - 1000: unsigned long nextTine - 0: void setup() { } void loop() { while (millis()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
