Test your understanding of `if`, `else`, `else if`, and simple decision-making in Arduino code
32-Lesson Course • Semester 1
What is the purpose of an `if` statement in Arduino?
Which operator correctly checks whether two values are equal?
What happens in an `if` / `else` statement?
In an `else if` chain, what does Arduino do after it finds the first true condition?
If a button uses `INPUT_PULLUP`, what value does it usually read when the button is pressed?
If `int score = 65;` and the code says `if (score >= 70)`, what happens?
Which condition means “temperature is greater than 30”?
What does this code do?if (buttonState == LOW) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); }
if (buttonState == LOW) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); }
Explain what `if (score >= 90)` means in your own words.
Describe a simple Arduino program that uses `if` and `else`. What value or input does it check, and what different actions can happen?
These results have been automatically sent to your instructor.