from gpiozero import TrafficLights
from time import sleep
from signal import pause

feu = TrafficLights(16, 20, 21)

def sequence_du_feu():
    while True:
        yield (0, 0, 1) # feu vert
        sleep(5)
        yield (0, 1, 0) # feu orange
        sleep(2)
        yield (1, 0, 0) # feu rouge
        sleep(5)

feu.source = sequence_du_feu ()

pause()
