Advertisement
Guest User

Untitled

a guest
May 5th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. # library for time delay
  2. import time;
  3. from random import randint
  4. # library for controlling pins (GPIO pins)
  5. import RPi.GPIO as GPIO;
  6.  
  7. # set GPIO pin 7 as output
  8. GPIO.setmode(GPIO.BOARD);
  9. GPIO.setup(8, GPIO.OUT);
  10.  
  11. # loop until user presses Ctrl + C
  12. while True:
  13. GPIO.output(8, True);
  14. time.sleep(randint(200,1000)/1000);
  15. GPIO.output(8, False);
  16. time.sleep(randint(200,1000)/1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement