Recall & Review
beginner
What is GPIO on a Raspberry Pi?
GPIO stands for General Purpose Input/Output. It is a set of pins on the Raspberry Pi that can be programmed to control electronic components like LEDs or read sensors.
Click to reveal answer
beginner
Why do we need to set the GPIO pin mode before using it?
Setting the GPIO pin mode tells the Raspberry Pi if the pin will be used to send signals (output) or receive signals (input). For blinking an LED, we set it as output.
Click to reveal answer
beginner
What does the following Python code do? <br>
GPIO.output(18, GPIO.HIGH)
This code turns on the device connected to GPIO pin 18 by sending a HIGH signal (3.3V), which can light up an LED.
Click to reveal answer
beginner
Why do we use a delay (like time.sleep) in an LED blink program?
The delay pauses the program so the LED stays on or off long enough for us to see the blinking effect clearly.
Click to reveal answer
beginner
What is the purpose of cleaning up GPIO pins at the end of a program?
Cleaning up resets the GPIO pins to a safe state, preventing unexpected behavior or damage when the program finishes.
Click to reveal answer
Which GPIO pin mode should you set to blink an LED?
✗ Incorrect
To control an LED, the pin must send signals, so it should be set as Output.
What does GPIO.HIGH mean in a Raspberry Pi program?
✗ Incorrect
GPIO.HIGH means the pin outputs a high voltage (3.3V), turning on connected devices like LEDs.
Why do we use time.sleep() in an LED blink program?
✗ Incorrect
time.sleep() pauses the program so the LED's on or off state is visible to our eyes.
What Python library is commonly used to control GPIO pins on Raspberry Pi?
✗ Incorrect
RPi.GPIO is the standard library to control GPIO pins on Raspberry Pi.
What should you do at the end of a GPIO program to avoid issues?
✗ Incorrect
Calling GPIO.cleanup() resets pins to safe states and prevents problems in future programs.
Explain step-by-step how to write a simple program to blink an LED using Raspberry Pi GPIO pins.
Think about what you need to do to make the LED turn on and off repeatedly.
You got /9 concepts.
Why is it important to use GPIO.cleanup() in your Raspberry Pi GPIO programs?
Consider what happens if pins stay set after your program ends.
You got /4 concepts.