#!/usr/bin/python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

Relay1 = 4
GPIO.setup(Relay1, GPIO.OUT)
GPIO.output(Relay1, 0)
Relay2 = 17
GPIO.setup(Relay2, GPIO.OUT)
GPIO.output(Relay2, 0)
Relay3 = 27
GPIO.setup(Relay3, GPIO.OUT)
GPIO.output(Relay3, 0)
Relay4 = 22
GPIO.setup(Relay4, GPIO.OUT)
GPIO.output(Relay4, 0)
Relay5 = 18
GPIO.setup(Relay5, GPIO.OUT)
GPIO.output(Relay5, 0)
Relay6 = 23
GPIO.setup(Relay6, GPIO.OUT)
GPIO.output(Relay6, 0)
Relay7 = 6
GPIO.setup(Relay7, GPIO.OUT)
GPIO.output(Relay7, 0)
Relay8 = 13
GPIO.setup(Relay8, GPIO.OUT)
GPIO.output(Relay8, 0)

Sensor1 = 19
GPIO.setup(Sensor1, GPIO.IN)
Sensor2 = 26
GPIO.setup(Sensor2, GPIO.IN)
Sensor3 = 21
GPIO.setup(Sensor3, GPIO.IN)
Sensor4 = 16
GPIO.setup(Sensor4, GPIO.IN)

print "Relay self-test beginning."
GPIO.output(Relay1, 1)
print "Relay 1 Active"
time.sleep(1)
GPIO.output(Relay2, 1)
print "Relay 2 Active"
time.sleep(1)
GPIO.output(Relay3, 1)
print "Relay 3 Active"
time.sleep(1)
GPIO.output(Relay4, 1)
print "Relay 4 Active"
time.sleep(1)
GPIO.output(Relay5, 1)
print "Relay 5 Active"
time.sleep(1)
GPIO.output(Relay6, 1)
print "Relay 6 Active"
time.sleep(1)
GPIO.output(Relay7, 1)
print "Relay 7 Active"
time.sleep(1)
GPIO.output(Relay8, 1)
print "Relay 8 Active"
time.sleep(1)

GPIO.output(Relay1, 0)
print "Relay 1 Off"
time.sleep(1)
GPIO.output(Relay2, 0)
print "Relay 2 Off"
time.sleep(1)
GPIO.output(Relay3, 0)
print "Relay 3 Off"
time.sleep(1)
GPIO.output(Relay4, 0)
print "Relay 4 Off"
time.sleep(1)
GPIO.output(Relay5, 0)
print "Relay 5 Off"
time.sleep(1)
GPIO.output(Relay6, 0)
print "Relay 6 Off"
time.sleep(1)
GPIO.output(Relay7, 0)
print "Relay 7 Off"
time.sleep(1)
GPIO.output(Relay8, 0)
print "Relay 8 Off"
time.sleep(1)
print "Relay self-test complete."

