Complete the code to import the GPIO library.
import [1] as GPIO
The RPi.GPIO library is used to control the GPIO pins on a Raspberry Pi.
Complete the code to set the GPIO mode to BCM numbering.
GPIO.setmode([1])Using GPIO.BCM sets the pin numbering to the Broadcom SOC channel numbers.
Fix the error in setting up pin 18 as output.
GPIO.setup(18, [1])
To control an LED, the pin must be set as an output using GPIO.OUT.
Complete the code to turn the LED on connected to pin 18.
GPIO.output(18, [1]) GPIO.cleanup()
Setting the pin to GPIO.HIGH turns the LED on. The GPIO.cleanup() function is called without arguments to reset all pins.
Fill all three blanks to blink the LED once with a 1 second delay.
GPIO.output([1], GPIO.HIGH) time.sleep([2]) GPIO.output([3], GPIO.LOW)
The LED is connected to pin 18, so we set pin 18 HIGH, wait 1 second, then set pin 18 LOW to blink once.
