wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Arduino - level 2

Total questions: 27

Worksheet time: 17mins

Name
Class
Date
1.

What is the name of the library that we include in our Arduino code to use this specific module?

a)

DS3231.h

b)

Servo.h

c)

LiquidCrystal_I2C.h

d)

Arduino.h

2.

Choose two (2) usage of this component in your daily lives:

a)

Reverse car sensor

b)

Alarm clock

c)

Speaker

d)

Distance sensor

3.

What are the TRUE differences between this component in the picture and a DC MOTOR?

a)

This component can turn to specific angle and DC Motors cannot

b)

This component need 3 wires to connect

c)

DC Motor can turn to 180 degrees only

d)

DC Motor needs a signal wire, 5V and GND; this component needs 2 wires only

4.

Besides <LiquidCrystal_I2C.h> library, which other library is needed to use a Liquid Crystal Display I2C?

a)

<Display.h>

b)

<RS3231.h>

c)

<Serial.h>

d)

<Wire.h>

5.

What does GPIO stand for?

a)

General Purpose Inner Outer Propeller

b)

General Purpose Input Output Pins

c)

General Purpose Interested Old People

d)

General Purpose Input Output Processor

6.

Mark the WRONG written codes.

a)

int X9=9;

b)

Int x9=9;

c)

serial.printLn(9600);

d)

void setup {

Serial.begin(9600);

}

7.

Which of the following is correct to write your name as a comment?

a)

/ Myname

b)

//Myname

c)

/*Myname

d)

<Myname>

8.

For the following code, which statement (s) will be executed? (Note: you can choose more than one)


int x=3;

int y=4;

if(x>y)

{ statement A;}

else {Statement B;}

Statement C;

a)

A

b)

B

c)

C

9.

for the following code, What is the right output?

for(int i=1;i<3;i++)

{Serial.begin(9600);

Serial.print("Hello");

}

a)

Hello

b)

HelloHello

c)

Hello

Hello

d)

Hello Hello

e)

HelloHelloHello

10.

A potentiometer is a

a)

Directional switch

b)

Directional resistor

c)

Sensor

d)

Variable resistor

e)

None of the above

11.

Photo resistors operate by

a)

Reducing resistance when less light is visible

b)

Increasing resistance when less light is visible

c)

Activates when motion is present

d)

All of the above

12.

Pins configured as OUTPUT with

a)

PinMode()

b)

Pinmode()

c)

pinmode()

d)

pinMode()

13.

The command which is used to display the characters in the serial monitor is

a)

Serial

b)

Serial.type

c)

Serial.printing

d)

Serial.println

14.

The line void setup() means that you are defining a function called setup

a)

True

b)

False

15.

A function is a series of programming statements that can be called by name. Which command is called once when the program starts:

a)

loop()

b)

setup()

c)

(output)

d)

(input)

e)

void()

16.

What is the output for the following code?

int x=5;

int y=3;

x+=y;

Serial.print(x+y);

a)

6

b)

8

c)

10

d)

11

17.

How to define a Led connected to pin 13 in Arduino?

a)

Pinmode(13,INPUT);

b)

pinMode(13,INPUT);

c)

Pinmode(13,OUTPUT);

d)

pinMode(13,OUTPUT);

18.

Where is the position of this command?

pinMode(8, OUTPUT);

a)

void setup()

b)

void loop()

19.

Where is the position of this command?

digitalWrite(8, HIGH);

a)

void setup()

b)

void loop()

20.

What does A&&B mean

a)

It is a logical AND operator

b)

It is a logical OR operator

c)

It is a multiplication operator

d)

it is a division operator

21.

A==7 means

a)

A is equal to 7

b)

7 is assigned as an int A

c)

A is not equal to 7

d)

A is greater than 7

22.

A!=3 means

a)

A is NOT equal to 3

b)

A is equal to 3

c)

A is greater than 3

d)

A is less than 3

23.

A||B is a/an

a)

OR logical operator

b)

AND logical operator

c)

Greater than or equal

d)

less than or equal

24.

What is the correct pinMode setup code for this circuit?

a)

pinMode(12, OUTPUT);

b)

pinMode(8, INPUT);

c)

pinMode(8, OUTPUT);

d)

pinMode(7, INPUT);

25.

An LED is an example of a Diode. What is the definition of Diode?


(HINT - an LED has a short leg and a long leg for this reason)

a)

Electricity needs to be controlled by a resistor for it to work

b)

It means LEDs can be multi-coloured

c)

A jumper wire needs to go to GND (ground) after it is connected to the LED

d)

Electricity can only flow through this component in one direction

26.

int Led1=4;

void setup(){

digitalWrite (LED1, High);

}

Find the errors?

a)

LED 1

b)

DigitalWrite

c)

HIGH

d)

Void Setup

27.

I use temperature sensor to read the room temperature. How do I write Temperature Sensor Set-up.

void setup(){

_______________________;

}

a)

PinMode (Tsensor, Output);

b)

pinMode (Tsensor, OUTPUT);

c)

PinMode (Tsensor, Input);

d)

pinMode (Tsensor, INPUT);