RGB LEDs & Serial Monitor with Arduino – Pre-Test | Lesson 5
1. What is the purpose of an RGB LED?
It stores data from the Arduino.
It displays multiple colors using red, green, and blue.
It measures temperature and humidity.
2. Which pins are used in the example to control the RGB LED?
Pins 2, 3, and 4
Pins 11, 10, and 9
Pins A0, A1, A2
3. What does the Serial.print() command do?
It turns on an LED.
It displays messages in the Serial Monitor.
It receives input from the user.
4. What is the purpose of while (Serial.available() == 0)?
To blink the LED.
To wait for user input before continuing.
To stop the program from starting.
5. What type of variable is 'colorinput'?
int
bool
String
6. Which statement correctly sends text to a new line in the Serial Monitor?
Serial.begin()
Serial.print()
Serial.println()
7. What is the difference between digitalWrite() and analogWrite()?
digitalWrite() sets HIGH or LOW, analogWrite() controls brightness.
They both do the same thing.
analogWrite() turns the pin off.
8. What does an 'if' statement do?
Repeats code over and over.
Makes decisions based on conditions.
Stops the sketch immediately.
9. What does a 'while' loop do?
Runs once and then stops.
Waits until a condition is met before moving on.
It prints values to the Serial Monitor.
10. What must you set the Serial Monitor to for this sketch to work properly?
BOTH NL & CR
No Line Ending
Newline Only
11. In your own words, explain what you think an RGB LED does and how it might be controlled in an Arduino project.
Submit Answers