Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- import time
- relais_pin = 25
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(relais_pin,GPIO.OUT)
- print "\nlinker relais an pin 25\n"
- while True:
- try:
- GPIO.output(relais_pin,True)
- time.sleep(0.5)
- GPIO.output(relais_pin,False)
- time.sleep(0.5)
- except KeyboardInterrupt:
- GPIO.output(relais_pin,False)
- GPIO.cleanup() # Clean up GPIO on CTRL+C exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement