Skip to content

Instantly share code, notes, and snippets.

@SaraM92
Created July 10, 2024 19:12
Show Gist options
  • Save SaraM92/cf1832058b0641349ae9cb5fcc804463 to your computer and use it in GitHub Desktop.
Save SaraM92/cf1832058b0641349ae9cb5fcc804463 to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
while True:
GPIO.output(18,GPIO.HIGH)
print("LED is ON")
time.sleep(1)
GPIO.output(18,GPIO.LOW)
print("LED is OFF")
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment