Recall & Review
beginner
What does non-blocking code architecture mean in Arduino programming?
It means writing code that does not stop or wait for tasks to finish before moving on. The program keeps running other parts while waiting for events or delays.
Click to reveal answer
beginner
Why should you avoid using delay() in Arduino sketches for non-blocking code?
Because delay() stops the whole program for a set time, blocking other tasks. Non-blocking code uses timers or checks time to keep the program responsive.
Click to reveal answer
beginner
Which Arduino function helps to check elapsed time without stopping the program?
The millis() function returns the number of milliseconds since the Arduino started. It helps track time without blocking the code.
Click to reveal answer
intermediate
How does using millis() support non-blocking code architecture?
By comparing the current millis() value to a stored time, the program can decide when to run tasks without stopping other code. This keeps the program active and responsive.
Click to reveal answer
beginner
What is a simple example of non-blocking code structure in Arduino?
Using millis() to check if a certain time passed, then running a task, instead of using delay(). This allows other code to run continuously.
Click to reveal answer
What happens when you use delay(1000) in Arduino code?
✗ Incorrect
delay(1000) stops the program for 1000 milliseconds (1 second), blocking all other code.
Which function is best to use for non-blocking timing in Arduino?
✗ Incorrect
millis() returns the time since the program started and allows checking elapsed time without stopping the program.
In non-blocking code, how do you check if a certain time has passed?
✗ Incorrect
You save the time when an event happens and compare it to millis() to see if enough time passed.
Why is non-blocking code important in Arduino projects?
✗ Incorrect
Non-blocking code keeps the program responsive and able to handle many tasks at once.
Which of these is a sign of blocking code?
✗ Incorrect
delay() stops the program and blocks other code from running.
Explain how you can use millis() to create a non-blocking delay in Arduino.
Think about checking time instead of stopping the program.
You got /5 concepts.
Why is non-blocking code architecture better for Arduino projects that handle multiple sensors or outputs?
Imagine trying to do many things at once without stopping.
You got /5 concepts.