wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Engineering First Semester

Total questions: 15

Worksheet time: 29mins

Name
Class
Date
1.

Which of the following will cause a pause of 3 seconds?

a)

delay(3);

b)

delay(300);

c)

delay(3000);

d)

digitalWrite(delay,3);

2.

Which of the following is special about what goes inside the {} following void setup () ?

a)

It runs only once

b)

It repeats 3 times

c)

It repeats over and over again

d)

It can only contain statements about pinMode

3.

In which of these programs do you NEED to use analogWrite?

a)

Turning on an LED

b)

Turning on an RGB LED

c)

Turning an RGB LED pink

d)

All of the above

4.

What will x equal at the end of the following code:


int x=4;

if (x!=4) {

x=3;

}

a)

3

b)

4

c)

int

d)

it could be anything

5.

What will x equal at the end of the following code:

int x=7;

if (x==7) {

x=3;

x++;}

else{

x=2;}

a)

2

b)

3

c)

4

d)

5

e)

7

6.

How many legs does an RGB LED have?

a)

1

b)

2

c)

3

d)

4

7.

When hooking up a button, where should you put the resistor?

a)

In between the button and ground

b)

In between the button's two legs

c)

You need 2 resistors, one between the button and ground, the other between the button and 5 V

d)

You don't need a resistor, it always works fine without one

8.

If I hook up an RGB LED's green leg to pin 5, and its ground leg to ground...what will the following line of code accomplish?


analogWrite(5,120);

a)

It will turn the LED blue

b)

It will turn the LED light green

c)

It will print 120 on the Serial Monitor

d)

It will print 5 on the Serial Monitor

9.

What is the difference between hooking up an LED to ground and 5V, or hooking it up to ground and pin 6?


(In both cases assume you have a resistor in the correct place)

a)

In the latter case, the LED can't possibly turn on

b)

In the latter case, the LED will always be on

c)

In the former case, the LED will always be on

d)

In the former case, the LED can't possibly turn on

10.

What will happen if you have the following as the loop section of your code:


void loop()

{

digitalWrite(13, HIGH); //turns on green LED

digitalWrite(13, LOW); //turns off green LED

digitalWrite(12, HIGH); //turns on yellow LED

digitalWrite(12, LOW); //turns off yellow LED

digitalWrite(11, HIGH); //turns on red LED

delay(1000);

digitalWrite(11, LOW); //turns off red LED


}

a)

You'll see a red LED

b)

You'll see a green LED

c)

You'll see a cyan LED

d)

You'll see an off LED

11.

When do you need to include Serial.begin(9600);

in the setup of your code?

a)

Whenever you plan to use an LED

b)

Whenever you plan to use a button

c)

Whenever you plan to print onto your Serial Monitor

d)

Whenever you plan to use analogWrite

12.

int place=1;

Serial.print("A");

Serial.print(place);


What will get printed?

a)

A1

b)

A

1

c)

Aplace

d)

A

place

13.

Which of the following is NOT a difference between digitalWrite and analogWrite?

a)

digitalWrite can only output HIGH or LOW, analogWrite can output 256 possible levels

b)

digitalWrite can attach to any pin 0 to 13, analogWrite can only be done on the pins with ~

c)

digitalWrite can only be used to turn off an RGB LED, analogWrite can be used to turn them on as well

d)

On a RGB LED, digitalWrite can create only certain colors, analogWrite can create a much wider range of colors

14.

Which of the following is an example of something that does INPUT and not OUTPUT?

a)

Button

b)

LED

c)

RGB LED

d)

Speaker

15.

Why is it so important to include a resistor in your circuits that turn on LEDs?

a)

Otherwise its impossible for the LED to turn on

b)

Otherwise the LED will burn out since too much electricity will flow through it

c)

Otherwise it may be tempted to join the government over the resistance

d)

Otherwise the breadboard won't provide electricity