May 2018
Intermediate to advanced
340 pages
7h 20m
English
As we are dealing with high voltage and higher currents, we would be using a relay. To do this, connect the wires as follows:

Once you are done connecting it, upload the following code and let's see what happens:
import RPi.GPIO as GPIOimport time LIGHT = 23GPIO.setmode(GPIO.BCM)GPIO.setwarnings(False)GPIO.setup(LIGHT,GPIO.OUT) import datetimeH = datetime.datetime.now().strftime('%H')M = datetime.datetime.now().strftime('%M') while True: if H = '06'and M < 20 : GPIO.output(LIGHT,GPIO.HIGH) else: GPIO.output(LIGHT,GPIO.LOW)
OK, then it is a fairly simple code with not much explanation needed. We have done ...