Search Header Logo

Push Button LED-digitalRead and digitalWrite

Authored by shumaila shereen

Computers

6th - 8th Grade

Push Button LED-digitalRead and digitalWrite
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does pinMode(2, INPUT); do?

It turns on the LED.

It tells the computer that pin 2 is connected to a button.

It makes the button glow.

It turns off the LED.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when the button is pressed?

The LED turns off.

The LED turns on.

The button glows.

Nothing happens.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does digitalWrite(13, HIGH); do?

It turns off the LED.

It checks if the button is pressed.

It turns on the LED.

It makes the button glow.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of delay(15);?

To make the LED blink faster.

To add a tiny pause so the computer doesn’t check too fast.

To turn off the button.

To make the LED brighter.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does button_state = digitalRead(2); do?

It turns on the LED.

It checks if the button is pressed or not.

It makes the button glow.

It turns off the LED.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of the LED in this code?

To act as a button.

To light up when the button is pressed.

To check if the button is working.

To make the button glow.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does if (button_state == HIGH) mean?

If the button is not pressed.

If the button is pressed.

If the LED is off.

If the LED is on.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?