forked from futureshocked/RaspberryPiFullStack_Raspbian
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblink.py
More file actions
14 lines (12 loc) · 686 Bytes
/
Copy pathblink.py
File metadata and controls
14 lines (12 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import RPi.GPIO as GPIO ## Import GPIO Library
import time ## Import 'time' library (for 'sleep')
pin = 7 ## We're working with pin 7
GPIO.setmode(GPIO.BOARD) ## Use BOARD pin numbering
## You can use BCM 4 if you prefer
GPIO.setup(pin, GPIO.OUT) ## Set pin 7 to OUTPUT
for i in range (0, 20): ## Repeat 20 times
GPIO.output(pin, GPIO.HIGH) ## Turn on GPIO pin (HIGH)
time.sleep(1) ## Wait 1 second
GPIO.output(pin, GPIO.LOW) ## Turn off GPIO pin (LOW)
time.sleep(1) ## Wait 1 second
GPIO.cleanup()