Skip to content

Instantly share code, notes, and snippets.

@ikizoglu
Created February 14, 2026 15:09
Show Gist options
  • Select an option

  • Save ikizoglu/4c0398b7e4482fd006d35b028882b97f to your computer and use it in GitHub Desktop.

Select an option

Save ikizoglu/4c0398b7e4482fd006d35b028882b97f to your computer and use it in GitHub Desktop.
RaspberryPi Röle+LED Kullanımı
#RaspberryPi Röle+LED Kullanımı
#-------------------------------
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BCM) # Use physical pin numbering
relay = 21
GPIO.setup(relay,GPIO.OUT)
GPIO.output(relay,False)
print("Relay is working:")
print("------------------")
while True:
GPIO.output(relay,True)
print("Power on")
time.sleep(5)
GPIO.output(relay,False)
print("Power Off")
time.sleep(2)
print("------------")
GPIO.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment