Created
July 4, 2016 11:55
-
-
Save shiranGinige/fcaf292d33cb9dd5b924c53b7a75bd71 to your computer and use it in GitHub Desktop.
RasberryPi snippets - blinking LED
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 | |
def blink(pin): | |
GPIO.output(pin,GPIO.HIGH) | |
time.sleep(1) | |
GPIO.output(pin,GPIO.LOW) | |
time.sleep(1) | |
return | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(11, GPIO.OUT) | |
for i in range(0,50): | |
blink(2) | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment