def get_pin(color):
    """traffic light color to GPIO pin mapping"""
    if color == "r":
        pin = 9
    elif color == "y":
        pin = 10
    elif color == "g":
        pin = 11
    else:
        raise RuntimeError("Do not support color %s." % color)
    return pin