wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Arduino Programming Quiz

Total questions: 35

Worksheet time: 25mins

Name
Class
Date
1.

What is the main programming language used to program Arduino?

a)

Python

b)

Java

c)

C/C++

d)

Assembly

2.

What is the function pinMode() used for in Arduino?

a)

To read a pin value

b)

To set a pin as input or output

c)

To reset a pin

d)

To write analog value

3.

What is the correct function to set a digital pin to HIGH in Arduino?

a)

digitalMode(HIGH)

b)

pinWrite(HIGH)

c)

digitalWrite(HIGH)

d)

digitalWrite(pin, HIGH)

4.

Which of the following is a correct way to start the Serial Monitor?

a)

Serial.start(9600);

b)

Serial.begin(9600);

c)

Begin.Serial(9600);

d)

serialMonitor(9600);

5.

Which pin on the Arduino Uno is used for analog input A0?

a)

Pin 13

b)

Pin 0

c)

Pin A0

d)

Pin D0

6.

Which command is used to create a delay in milliseconds?

a)

wait(1000);

b)

pause(1000);

c)

delay(1000);

d)

hold(1000);

7.

What is the data type used to store integer values in C?

a)

string

b)

float

c)

int

d)

double

8.

What symbol is used to make a comment in C/Arduino code?

a)

//

b)

#

c)

**

d)

\

9.

What is the result of 5 % 2 in C?

a)

2

b)

1

c)

0

d)

2.5

10.

Which C statement is used to make decisions?

a)

switch

b)

if

c)

while

d)

both A and B

11.

Which function is executed only once in an Arduino sketch?

a)

loop()

b)

main()

c)

void()

d)

setup()

12.

Which function repeats forever in Arduino code?

a)

loop()

b)

setup()

c)

mainloop()

d)

run()

13.

Which one is not a valid C data type?

a)

bool

b)

double

c)

real

d)

char

14.

How do you declare a variable in C?

a)

var x = 5;

b)

int x = 5;

c)

declare x = 5;

d)

x := 5;

15.

What is the correct way to define an array of 5 integers?

a)

int a[5];

b)

int a = [5];

c)

array int[5];

d)

int[5] a;

16.

Arduino Uno has 6 analog input pins.

a)

True

b)

False

17.

The loop() function in Arduino only runs once.

a)

True

b)

False

18.

You can power the Arduino through the USB port.

a)

True

b)

False

19.

‘int’ in C is used to store decimal numbers.

a)

True

b)

False

20.

‘delayMicroseconds(1000)’ waits for 1 millisecond.

a)

True

b)

False

21.

An ‘if’ statement must always have an ‘else’.

a)

True

b)

False

22.

A resistor is needed when connecting an LED to an Arduino.

a)

True

b)

False

23.

The ‘&&’ operator means logical OR.

a)

True

b)

False

24.

C is a case-sensitive programming language.

a)

True

b)

False

25.

A for loop can never be infinite.

a)

True

b)

False

26.

The function used to print to the Serial Monitor is (a)   .

27.

The default baud rate for Arduino Serial communication is (a)   .

28.

A digital pin set to HIGH has a voltage of (a)   .

29.

To read an analog value from A0, use the function (a)   .

30.

The extension of an Arduino sketch file is (a)   .

31.

What does the following code do? digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000);

a)

Keeps LED off

b)

Turns LED on and off every second

c)

Reads sensor value

d)

No output

32.

Find the error in this code: int x = "5";

4 lines
33.

What is the output of the following C code? int a = 5, b = 2; printf("%d", a / b);

(a)  

34.

What is the role of #include ?

4 lines
35.

Fix the following code to blink an LED on pin 7: void setup() { pinMode(7, INPUT); } void loop() { digitalWrite(7, HIGH); delay(500); digitalWrite(7, LOW); delay(500); }

4 lines