Last active
May 26, 2016 21:36
This file contains 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
/** | |
* @Author: Jordi Corbilla | |
* (c) Copyright by Jordi Corbilla. | |
**/ | |
import RPi.GPIO as GPIO | |
import time | |
from array import * | |
GPIO.setmode(GPIO.BOARD) | |
#Set up GPIO pins #extension board pin name | |
GPIO.setup(7, GPIO.OUT) #GP7 | |
GPIO.setup(11, GPIO.OUT) #GP0 | |
GPIO.setup(12, GPIO.OUT) #GP1 | |
GPIO.setup(13, GPIO.OUT) #GP2 | |
GPIO.setup(15, GPIO.OUT) #GP3 | |
GPIO.setup(16, GPIO.OUT) #GP4 | |
GPIO.setup(18, GPIO.OUT) #GP5 | |
GPIO.setup(22, GPIO.OUT) #GP6 | |
#Set up naming for RPi extension board | |
GPIOArray = array('i', [11, 12, 13, 15, 16, 18, 22, 7]) | |
wtime = 0.01 | |
while True: | |
for i in range (0,7): | |
GPIO.output(GPIOArray[i], GPIO.HIGH) | |
print "Output %d value is %r" % (GPIOArray[i], 1) | |
time.sleep(wtime) | |
GPIO.output(GPIOArray[i], GPIO.LOW) | |
print "Output %d value is %r" % (GPIOArray[i], 0) | |
time.sleep(wtime) | |
#slowing the flashing | |
wtime = wtime + 0.01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment