Last active
December 21, 2015 16:28
-
-
Save Edocsyl/6333349 to your computer and use it in GitHub Desktop.
Raspberry PI Rev 1 & 8 Channel Relay module; This script goes through every defined gpio port and powers every relay for 0.5 sec.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import RPi.GPIO as GPIO, time as t | |
#Define GPIO Ports http://bit.ly/14RmXp2 | |
r = [8, 10, 12, 16, 18, 22, 24, 26] | |
#Setup GPIO | |
GPIO.setwarnings(False) | |
GPIO.cleanup() | |
GPIO.setmode(GPIO.BOARD) | |
#Go through every port | |
for i in r: | |
GPIO.setup(i, GPIO.OUT) | |
GPIO.output(i, False) | |
t.sleep(0.5) | |
GPIO.output(i, True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment