Complete the code to import the GPIO library for Raspberry Pi.
import [1] as GPIO
The RPi.GPIO library is used to control GPIO pins on Raspberry Pi.
Complete the code to set GPIO pin 18 as an output pin.
GPIO.setmode(GPIO.BCM)
GPIO.setup([1], GPIO.OUT)Pin 18 is set as output to control the water pump.
Fix the error in the code to read moisture sensor value from pin 23.
GPIO.setup(23, GPIO.IN) moisture = GPIO.[1](23)
Use GPIO.input(pin) to read digital input from a pin.
Fill both blanks to turn on the water pump when soil is dry.
if moisture [1] 0: GPIO.output([2], GPIO.HIGH)
If moisture sensor reads 0 (dry), turn on pump at pin 18.
Fill both blanks to create a dictionary of sensor readings with pin as key and value as moisture.
sensor_data = {[2]: [1] for [3] in [23, 24, 25]}This dictionary comprehension reads moisture from pins 23, 24, and 25.
