Advertisement
schuetz

relais test

Apr 27th, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. relais_pin = 25
  5.  
  6. GPIO.setmode(GPIO.BCM)
  7. GPIO.setup(relais_pin,GPIO.OUT)
  8.  
  9. print "\nlinker relais an pin 25\n"
  10.  
  11. while True:
  12.     try:
  13.         GPIO.output(relais_pin,True)
  14.         time.sleep(0.5)
  15.         GPIO.output(relais_pin,False)
  16.         time.sleep(0.5)
  17.  
  18.     except KeyboardInterrupt:
  19.         GPIO.output(relais_pin,False)
  20.         GPIO.cleanup() # Clean up GPIO on CTRL+C exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement