Skip to content

Instantly share code, notes, and snippets.

@abdul-rehman-2050
Created February 11, 2018 13:06
Show Gist options
  • Save abdul-rehman-2050/e268b2b216033f90781b1c1818d7b1d0 to your computer and use it in GitHub Desktop.
Save abdul-rehman-2050/e268b2b216033f90781b1c1818d7b1d0 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
#global veriables
LED_Pin = 16
delay = 0.5
#setup your pins and GPIO mode
GPIO.setmode(GPIO.BOARD)
GPIO.setup(LED_Pin,GPIO.OUT)
#your main code
for i in range(1,50):
GPIO.output(LED_Pin,GPIO.HIGH)
time.sleep(0.5)
GPIO.output(LED_Pin,GPIO.LOW)
time.sleep(0.5)
#finally clear everything once code is about to finish
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment