Which command delays the LED by a number of milliseconds?

Study for the Internet of Things (IOT102) Test. Access comprehensive flashcards and multiple choice questions, each with hints and explanations. Get prepared for your exam!

Multiple Choice

Which command delays the LED by a number of milliseconds?

Explanation:
Timing control in microcontroller code often requires a pause to create a visible LED blink. The delay function does exactly that: it halts the program for the number of milliseconds you pass to it, so the LED stays on or off for that duration before the next instruction runs. Loop runs over and over, not a pause; setup runs once at startup; stop isn't a built-in delay function. If you needed non-blocking timing, you’d use millis() and a state machine, but for a simple, explicit pause, delay is the right tool.

Timing control in microcontroller code often requires a pause to create a visible LED blink. The delay function does exactly that: it halts the program for the number of milliseconds you pass to it, so the LED stays on or off for that duration before the next instruction runs. Loop runs over and over, not a pause; setup runs once at startup; stop isn't a built-in delay function. If you needed non-blocking timing, you’d use millis() and a state machine, but for a simple, explicit pause, delay is the right tool.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy