🔵 PART 6 — setup() AND loop()

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/4

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:05 PM on 9/12/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

5 Terms

1
New cards

What is void setup() used for?

setup() runs once when the Arduino starts or resets.


It is commonly used to configure pins and initialise components.

2
New cards

What is void loop() used for?

loop() runs continuously/in an infinite loop while the Arduino is operating.

3
New cards

What is the difference between setup() and loop()?

setup() → runs once

loop() → runs repeatedly


Easy memory trick:

SETUP = Set things up once.

LOOP = Keep doing it.

4
New cards

What does this code mean?



void setup() {

pinMode(2, INPUT);

pinMode(13, OUTPUT);

}

When the Arduino starts:

  • Pin 2 is configured as an INPUT

  • Pin 13 is configured as an OUTPUT


5
New cards

Why does loop() need to run continuously in an interactive system?

So the Arduino can continuously check inputs, process information and respond with outputs.