Skip to content

Instantly share code, notes, and snippets.

@hoto17296
Last active March 22, 2018 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoto17296/432c64a3f3eb6146880b8b05992f8e14 to your computer and use it in GitHub Desktop.
Save hoto17296/432c64a3f3eb6146880b8b05992f8e14 to your computer and use it in GitHub Desktop.
Raspberry Pi GPIO Practice
import RPi.GPIO as GPIO
import time
INTERVAL = 0.5
GPIO.setmode(GPIO.BCM)
PIN = 3
GPIO.setup(PIN, GPIO.OUT)
try:
status = True
while True:
status = not status
GPIO.output(PIN, status)
time.sleep(INTERVAL)
except KeyboardInterrupt:
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment