Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import RPi.GPIO as GPIO
- import time
- x = "50"
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(21, GPIO.OUT)
- # time to sleep between operations in the main loop
- # main loop
- while x == "50":
- time.sleep(1)
- GPIO.output(21, GPIO.HIGH)
- print("on")
- time.sleep(1)
- GPIO.output(21, GPIO.LOW)
- print("off")
- # Reset GPIO settings
- GPIO.cleanup()
- # find more information on this script at
- # http://youtu.be/oaf_zQcrg7g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement