Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Codigo parpadeo de un LED en Raspberry Pi con python
- ## http://ingenieroaburrido.com
- import RPi.GPIO as GPIO
- import time
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(22, GPIO.OUT) ## GPIO 22 como salida
- for i in range(30): ## Bucle que se repetirá 30 veces
- GPIO.output(22, True) ## Encendemos el LED
- time.sleep(1) ## Esperamos 1 segundo
- GPIO.output(22, False) ## Apagamos el LED
- time.sleep(1) ## Esperamos 1 segundo
- GPIO.cleanup() ##Limpiamos los GPIO por si hubiese quedado alguno activo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement