Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gpiozero import LED
- from time import sleep
- import random
- yel = LED(17)
- green = LED(27)
- while True:
- randNum1 = random.choice([True, False])
- randNum2 = random.choice([True, False])
- #print("Num 1")
- #print(randNum1)
- #print("Num 2")
- #print(randNum2)
- print() #added to slow things down a bit.
- sleep(0.05)
- if randNum1 == True:
- yel.on()
- randNum2 = random.choice([True, False])
- if randNum2 == True:
- green.on()
- else:
- green.off()
- else:
- yel.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement