Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # library for time delay
- import time;
- from random import randint
- # library for controlling pins (GPIO pins)
- import RPi.GPIO as GPIO;
- # set GPIO pin 7 as output
- GPIO.setmode(GPIO.BOARD);
- GPIO.setup(8, GPIO.OUT);
- # loop until user presses Ctrl + C
- while True:
- GPIO.output(8, True);
- time.sleep(randint(200,1000)/1000);
- GPIO.output(8, False);
- time.sleep(randint(200,1000)/1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement