The Complete Beginners Guide to Arduino - 2021 - Interactive Traffic Lights

The Complete Beginners Guide to Arduino - 2021 - Interactive Traffic Lights

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Wayground Content

FREE Resource

This tutorial explains how to make a traffic light simulation interactive by adding a button. It covers wiring the button to an Arduino Nano, modifying the code to include a button press detection, and using a while loop to control the traffic light sequence. The tutorial ensures that the traffic light system allows vehicles to move and pedestrians to cross safely, with a delay to prevent constant button pressing.

Read more

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to the traffic lights when the button is pressed?

The vehicle light turns yellow and the pedestrian light turns blue.

Both lights turn off.

The vehicle light stays green and the pedestrian light stays red.

The vehicle light turns red and the pedestrian light turns green.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How long do pedestrians have to cross the road after the light changes?

5 seconds

10 seconds

15 seconds

20 seconds

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using a momentary push button in the circuit?

To keep the lights permanently on.

To make the traffic light sequence interactive.

To change the color of the lights.

To disconnect the circuit.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is it unnecessary to use an external resistor with the button?

Because the button is already connected to a power source.

Because the button is not part of the circuit.

Because the Arduino Nano has built-in pull-up resistors.

Because resistors are not needed in this circuit.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What pin mode is set for the button in the code?

ANALOG

OUTPUT

INPUT

INPUT_PULLUP

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a high signal on the button pin indicate?

The button is pressed.

The button is not pressed.

The light is off.

The circuit is broken.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of the while loop in the main code?

To continuously change the light sequence.

To wait for the button to be pressed.

To turn off the lights.

To reset the circuit.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?