Setting up the the pins on the raspberry pi import RPi.GPTO as GPIO import time
GPIO. setmode (cPIO.BCH)
GPIO. setwarnings (False)
CPIO. setup (21, GPIO. OUT) GPIO. setup (20, GPIO.OUT) def yello (seconds):
(PIO. output (21, GPIO.HIGH) time.sleep (seconds)
GPIO. output (21, GPIO. LOw) time.sleep (seconds)
def red(seconds) :
GPIO. output (20, GPIO.HIGH) time.sleep (seconds)
GPIO. output (20, GPIO. LOM) time. sleep (seconds)
red(0.2)
yellow (0.4)
red(0.75)
yellow (0.3)
red(0.2)
yellow(0.4)
red (0.25)
yellow (0.125)
red(0.3)
Low(0.5)
yellow (0.2)
red(0.3)
red (0.432)
yellow(0.4)
red (0.66)
yellow (0.2)
red(0.2)
red(o.s)
yellow(0.2)
yellow(0.6232)
yellow (0.2255)
red(0.55585)
red(0.95)
red(0.11)
yellow (o.ss)
(0.99)
red(0. 335)
yellow (0.89753)