Push Button LED-digitalRead and digitalWrite

Push Button LED-digitalRead and digitalWrite

6th - 8th Grade

10 Qs

quiz-placeholder

Similar activities

Electronics

Electronics

7th - 9th Grade

10 Qs

Input, Output, Storage

Input, Output, Storage

6th - 8th Grade

10 Qs

Using a Nikon CoolPix Camera

Using a Nikon CoolPix Camera

4th - 8th Grade

11 Qs

Control Systems Quiz

Control Systems Quiz

4th Grade - University

11 Qs

Python Turtle - MCA Year 7

Python Turtle - MCA Year 7

7th Grade

14 Qs

Pop Quiz #3

Pop Quiz #3

6th Grade

15 Qs

Arduino

Arduino

KG - University

8 Qs

Microbit Lesson 1

Microbit Lesson 1

7th Grade

10 Qs

Push Button LED-digitalRead and digitalWrite

Push Button LED-digitalRead and digitalWrite

Assessment

Quiz

Computers

6th - 8th Grade

Hard

Created by

shumaila shereen

FREE Resource

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.

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?