Lesson 4 Pre-Test
1. How many LEDs are used in the traffic light circuit?
1
2
3
2. What color is NOT used in the traffic light circuit?
Red
Yellow
Blue
3. What does the shorter leg of an LED connect to?
Digital Pin
GND
VCC
4. What is the function of a resistor in the LED circuit?
It increases current
It prevents LED from burning out
It blinks the LED
5. What does the delay(5000) function do?
Waits 5 seconds
Changes LED color
Reads analog input
6. Which function allows the yellow LED to blink three times?
digitalWrite()
for loop
delay()
7. What does the update part of a for loop do?
Repeats the entire sketch
Increases or changes the counter
Deletes a variable
8. What should you check if the LED doesn’t light up?
LED color
Wiring and code pin numbers
Internet connection
9. What might happen if you forget a semicolon in your code?
Nothing happens
The code won’t compile
The LED will blink randomly
10. What is the best first step when your code doesn’t work?
Stay calm and check spelling
Throw away the Arduino
Restart your computer immediately
11. In your own words, explain how you think a traffic light circuit works using LEDs, resistors, and Arduino code. What steps do you think the program follows to make the lights change?
Submit Answers