Complete the code to set GPIO pin 18 as output.
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(18, [1])
GPIO.OUT sets the pin as an output pin so you can send signals.
Complete the code to turn GPIO pin 18 ON (set it HIGH).
GPIO.output(18, [1])
GPIO.HIGH sets the pin voltage to high, turning it ON.
Fix the error in the code to turn GPIO pin 23 OFF (set it LOW).
GPIO.output(23, [1])
GPIO.LOW sets the pin voltage to low, turning it OFF.
Fill both blanks to create a dictionary of pin states for pins 17 and 27, setting 17 HIGH and 27 LOW.
pin_states = {17: [1], 27: [2]Pin 17 is set HIGH to turn ON, pin 27 is set LOW to turn OFF.
Fill all three blanks to set up pin 22 as output, turn it ON, and then clean up GPIO.
GPIO.setup(22, [1]) GPIO.output(22, [2]) GPIO.[3]()
First, set pin 22 as output with GPIO.OUT, then turn it ON with GPIO.HIGH, and finally clean up with GPIO.cleanup().
