Skip to content

Instantly share code, notes, and snippets.

@ellieayla
Created May 2, 2021 18:08
Show Gist options
  • Save ellieayla/525f5f16112c9662c76ad18557a5c279 to your computer and use it in GitHub Desktop.
Save ellieayla/525f5f16112c9662c76ad18557a5c279 to your computer and use it in GitHub Desktop.
Pulse Raspberry PI GPIO pin for 1 second
from gpiozero import LED
from time import sleep
# https://gpiozero.readthedocs.io/en/stable/recipes.html
# Pi Model 3B V1.2
output_relay = LED(4)
def pulse(out=output_relay):
out.on()
sleep(1)
out.off()
if __name__ == "__main__":
pulse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment