Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as gpio
- import time
- import random
- gpio.setmode(gpio.BOARD)
- basenum = 50
- basenum += randint(1, 5)
- pins = [26, 18, 16]
- for i in pins:
- gpio.setup(i, gpio.OUT)
- for i in range(1, basenum):
- gpio.output(pins[i%3], gpio.HIGH)
- time.sleep(i * 0.03)
- if n != basenum - 1:
- gpio.output(pins[1%3], gpio.LOW)
- time.sleep(5)
- gpio.cleanup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement