Advertisement
zvika

Raspberry Pi Blink - Python version

Oct 20th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
  2. from time import sleep # Import the sleep function from the time module
  3. GPIO.setwarnings(False) # Ignore warning for now
  4. GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
  5. GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and set initial value to low (off)
  6. while True: # Run forever
  7.  GPIO.output(8, GPIO.HIGH) # Turn on
  8.  sleep(1) # Sleep for 1 second
  9.  GPIO.output(8, GPIO.LOW) # Turn off
  10.  sleep(1) # Sleep for 1 second
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement