wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Diagnostic Test for CS202

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What does GPIO stand for?

a)

General Purpose Input/Output Device

b)

General Purpose Integrated Output

c)

General Purpose Input/Output

d)

Generalized Peripheral Input/Output

2.

Which Python library is commonly used for GPIO programming on Raspberry Pi?

a)

Adafruit_BBIO

b)

RPi.GPIO

c)

WiringPi

d)

RPi.GPIO2

3.

How do you set a GPIO pin as an input in Python?

a)

GPIO.set_input(pin_number)

b)

GPIO.setup(pin_number, GPIO.IN)

c)

GPIO.configure(pin_number, 'input')

d)

GPIO.pin_mode(pin_number, 'input')

4.

How can you read the state of a GPIO pin in Python?

a)

Use the Arduino IDE to read GPIO states.

b)

Connect a multimeter to measure the voltage.

c)

Use RPi.GPIO or gpiozero library to read the state of a GPIO pin.

d)

Use a web browser to access GPIO settings.

5.

What command is used to set a GPIO pin to HIGH?

a)

digitalWrite(pin, HIGH)

b)

gpioSet(pin, 1)

c)

setPin(pin, 1)

d)

writePin(pin, true)

6.

Which GPIO pin is typically used for the Raspberry Pi's ground?

a)

GPIO pin 1 (3.3V)

b)

GPIO pin 6 (GND)

c)

GPIO pin 5 (GPIO 3)

d)

GPIO pin 12 (GPIO 18)

7.

How do you control an LED connected to a GPIO pin?

a)

Connect the LED directly to the power supply.

b)

Use a resistor to connect the LED to the ground only.

c)

Set the GPIO pin as output and control it using HIGH/LOW signals.

d)

Set the GPIO pin as input and leave it unconnected.

8.

What is the function of the RPi.GPIO library?

a)

To enhance video playback on a Raspberry Pi.

b)

To manage network connections on a Raspberry Pi.

c)

To optimize power consumption of a Raspberry Pi.

d)

To control GPIO pins on a Raspberry Pi.

9.

How do you safely clean up GPIO settings in a Python script?

a)

Delete the GPIO library from your script.

b)

Ignore GPIO settings and continue running the script.

c)

Use GPIO.reset() to clear settings.

d)

Call GPIO.cleanup() at the end of your script or in a finally block.

10.

What is the default voltage level for a GPIO pin on a Raspberry Pi?

a)

5V

b)

3.3V

c)

12V

d)

1.8V