Which two functions does the Arduino IDE have in a sketch?

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 two functions does the Arduino IDE have in a sketch?

Explanation:
In an Arduino sketch, your program is built around two functions that the runtime expects: setup() and loop(). setup() runs once when the board starts or is reset, and it's where you initialize things like pin modes, serial communication, or peripherals. After setup finishes, loop() starts and keeps running over and over, allowing your sketch to read sensors, react to inputs, and control outputs continuously. That’s why setup() and loop() are the two functions involved. The build process isn’t a user-defined function you write like this; it’s part of the IDE’s background compilation and upload flow. You can add helper functions as needed, but there should be exactly one setup() and one loop() in a sketch for the program to run as intended.

In an Arduino sketch, your program is built around two functions that the runtime expects: setup() and loop(). setup() runs once when the board starts or is reset, and it's where you initialize things like pin modes, serial communication, or peripherals. After setup finishes, loop() starts and keeps running over and over, allowing your sketch to read sensors, react to inputs, and control outputs continuously.

That’s why setup() and loop() are the two functions involved. The build process isn’t a user-defined function you write like this; it’s part of the IDE’s background compilation and upload flow. You can add helper functions as needed, but there should be exactly one setup() and one loop() in a sketch for the program to run as intended.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy