Created
January 2, 2016 17:00
-
-
Save l337quez/fb08de73a616877b1ded to your computer and use it in GitHub Desktop.
blind two led in python
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
import RPI.GPIO as GPIO | |
import time | |
#definimos la funcion blind | |
def blink(pin): | |
GPIO.output(pin,GPIO.HIGH) | |
time.sleep(1) | |
GPIO.output(pin,GPIO.LOW) | |
time.sleep(1) | |
return | |
#Para usar los pines de la tarjeta Raspberry | |
GPIO.setmode(GPIO.BOARD) | |
#Configuramos el numero de los pines de salida | |
GPIO.setup(11, GPIO.OUT) | |
GPIO.setup(13, GPIO.OUT) | |
#Ciclo de ejecucion | |
for i in range (0,4) | |
blink(11) | |
blink(13) | |
GPIO.cleanup() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment