Created
July 13, 2019 03:12
-
-
Save winhtut/079bd3f20a2a6a8e5dd66bf8bd3cd65d to your computer and use it in GitHub Desktop.
Raspberry Pi For Beginner
This file contains hidden or 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 Raspberry Pi GPIO library | |
from time import sleep # Import the sleep function from the time module | |
GPIO.setwarnings(False) # Ignore warning for now | |
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering | |
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and set initial value to low (off) | |
while True: # Run forever | |
GPIO.output(8, GPIO.HIGH) # Turn on | |
sleep(1) # Sleep for 1 second | |
GPIO.output(8, GPIO.LOW) # Turn off | |
sleep(1) # Sleep for 1 second |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment