#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is copyright (c) 2016, P. Lutus and is released # under the GPL (http://www.gnu.org/licenses/gpl-3.0.en.html). import time, signal, sys import RPi.GPIO as G G.setmode(G.BCM) G.setwarnings(False) relay = 2 time_delay = 1 # seconds G.setup(relay,G.OUT) state = True try: while True: G.output(relay,state) state = not state time.sleep(time_delay) except: G.cleanup() print('So long for now.')