A function is a series of programming statements that can be called by name. Which command is called once when the program starts?

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

A function is a series of programming statements that can be called by name. Which command is called once when the program starts?

Explanation:
Functions are blocks of code you can call by name, and in this environment there are two special ones: one that runs once at startup and another that loops continuously. The one that executes only a single time when the device powers up or resets is setup. This is where you put initialization tasks such as configuring pin modes, starting serial communication, or setting initial values. Once setup finishes, the program moves into the loop, which then runs repeatedly. The other options don’t fit because loop is designed to run over and over, while terms like output or input aren’t the built-in startup routine.

Functions are blocks of code you can call by name, and in this environment there are two special ones: one that runs once at startup and another that loops continuously. The one that executes only a single time when the device powers up or resets is setup. This is where you put initialization tasks such as configuring pin modes, starting serial communication, or setting initial values. Once setup finishes, the program moves into the loop, which then runs repeatedly. The other options don’t fit because loop is designed to run over and over, while terms like output or input aren’t the built-in startup routine.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy