wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Coding grade 8

Total questions: 67

Worksheet time: 34mins

Name
Class
Date
1.

Which function runs once when the Arduino starts?

a)

loop()

b)

setup()

c)

delay()

d)

if

2.

Which function runs repeatedly forever?

a)

setup()

b)

pinMode()

c)

loop()

d)

for

3.

Which function sets a pin as INPUT or OUTPUT?

a)

digitalWrite()

b)

pinMode()

c)

digitalRead()

d)

analogRead()

4.

Which function turns a pin ON or OFF?

a)

digitalRead()

b)

analogWrite()

c)

digitalWrite()

d)

delay()

5.

Which function reads ON or OFF from a pin?

a)

digitalRead()

b)

digitalWrite()

c)

analogRead()

d)

Serial.println()

6.

Which function reads sensor values from 0 to 1023?

a)

digitalRead()

b)

analogRead()

c)

analogWrite()

d)

pinMode()

7.

Which function controls brightness or speed (0–255)?

a)

analogRead()

b)

delay()

c)

analogWrite()

d)

digitalRead()

8.

Which function waits for some time in milliseconds?

a)

for

b)

if

c)

delay()

d)

loop()

9.

Which keyword is used to make a decision?

a)

for

b)

if

c)

setup()

d)

delay()

10.

Which keyword repeats code many times?

a)

if

b)

delay()

c)

for

d)

Serial.begin()

11.

Which function starts the Serial Monitor?

a)

Serial.println()

b)

Serial.begin()

c)

digitalWrite()

d)

analogRead()

12.

Which function prints a message with a new line?

a)

Serial.begin()

b)

Serial.print()

c)

Serial.println()

d)

delay()

13.

Which function is usually written at the top of an Arduino program?

a)

loop()

b)

setup()

c)

for

d)

if

14.

Which function is best for controlling LED brightness?

a)

digitalRead()

b)

analogRead()

c)

analogWrite()

d)

pinMode()

15.

Which function is used before digitalWrite()?

a)

delay()

b)

pinMode()

c)

Serial.println()

d)

for

16.

setup() runs again and again forever.

a)

True

b)

False

17.

loop() runs only once when Arduino starts.

a)

True

b)

False

18.

pinMode() is used to read sensor values.

a)

True

b)

False

19.

digitalWrite() can turn a pin ON or OFF.

a)

True

b)

False

20.

digitalRead() returns HIGH or LOW.

a)

True

b)

False

21.

analogRead() values range from 0 to 1023.

a)

True

b)

False

22.

analogWrite() values range from 0 to 255.

a)

True

b)

False

23.

delay() uses seconds as its unit.

a)

True

b)

False

24.

if is used to repeat code many times.

a)

True

b)

False

25.

for is used for repeating code.

a)

True

b)

False

26.

Serial.begin() starts communication with the Serial Monitor.

a)

True

b)

False

27.

Serial.println() prints without moving to a new line.

a)

True

b)

False

28.

digitalWrite() reads values from a pin.

a)

True

b)

False

29.

analogRead() is used only with digital pins.

a)

True

b)

False

30.

loop() is required in every Arduino program.

a)

True

b)

False

31.

setup() is required in every Arduino program.

a)

True

b)

False

32.

pinMode() can set a pin as OUTPUT.

a)

True

b)

False

33.

delay(1000) waits for 1 second.

a)

True

b)

False

34.

analogWrite() can control motor speed.

a)

True

b)

False

35.

digitalRead() reads only ON or OFF values.

a)

True

b)

False

36.

Serial.println() is used to show messages on the Serial Monitor.

a)

True

b)

False

37.

for is not a function, it is a loop keyword.

a)

True

b)

False

38.

if is used for making decisions in code.

a)

True

b)

False

39.

analogWrite() works with values up to 1023.

a)

True

b)

False

40.

digitalWrite() can be used after setting pinMode().

a)

True

b)

False

41.

INPUT components send ______ to the Arduino.

a)

power

b)

commands

c)

information

d)

light

42.

Which function reads INPUT data?

a)

digitalWrite()

b)

analogWrite()

c)

digitalRead()

d)

delay()

43.

Which function is used to read analog sensors?

a)

digitalRead()

b)

analogRead()

c)

digitalWrite()

d)

Serial.begin()

44.

OUTPUT components ______ commands from Arduino.

a)

send

b)

block

c)

receive

d)

ignore

45.

Which function controls OUTPUT components?

a)

digitalRead()

b)

analogRead()

c)

digitalWrite()

d)

if

46.

Which of the following is an INPUT component?

a)

LED

b)

Buzzer

c)

Push Button

d)

Servo Motor

47.

Which of the following is an OUTPUT component?

a)

LDR

b)

PIR Sensor

c)

Ultrasonic Sensor

d)

LED

48.

Which component is used to measure distance?

a)

PIR Sensor

b)

Ultrasonic Sensor

c)

LDR

d)

Joystick

49.

Which INPUT component detects motion?

a)

LDR

b)

PIR Sensor

c)

Gas Sensor

d)

Potentiometer

50.

Which INPUT component measures light?

a)

IR Sensor

b)

LDR

c)

Joystick

d)

Sound Sensor

51.

Which OUTPUT component makes sound?

a)

LED

b)

Buzzer

c)

Fan

d)

Relay

52.

Which OUTPUT component shows text or numbers?

a)

Relay

b)

Servo Motor

c)

LCD Display

d)

Gas Sensor

53.

Which OUTPUT component rotates to a specific angle?

a)

DC Motor

b)

Stepper Motor

c)

Servo Motor

d)

Fan

54.

Which OUTPUT component can turn high-power devices ON or OFF?

a)

LED

b)

Relay Module

c)

RGB LED

d)

Buzzer

55.

Which component can move in many steps?

a)

Servo Motor

b)

DC Motor

c)

Stepper Motor

d)

Fan

56.

INPUT components send information to Arduino.

a)

True

b)

False

57.

OUTPUT components send data to Arduino.

a)

True

b)

False

58.

digitalRead() is used for INPUT components.

a)

True

b)

False

59.

analogWrite() is used for INPUT components.

a)

True

b)

False

60.

Push Button is an INPUT component.

a)

True

b)

False

61.

LED is an OUTPUT component.

a)

True

b)

False

62.

Joystick is an INPUT component.

a)

True

b)

False

63.

Ultrasonic Sensor is an OUTPUT component.

a)

True

b)

False

64.

Buzzer is an INPUT component.

a)

True

b)

False

65.

PIR Sensor detects motion.

a)

True

b)

False

66.

LCD Display receives commands from Arduino.

a)

True

b)

False

67.

Fan is an OUTPUT component.

a)

True

b)

False