Skip to content

Instantly share code, notes, and snippets.

@jonwitts
Last active April 16, 2017 20:17
Show Gist options
  • Save jonwitts/2f99ff898dc37c6e5bf789193c8f071e to your computer and use it in GitHub Desktop.
Save jonwitts/2f99ff898dc37c6e5bf789193c8f071e to your computer and use it in GitHub Desktop.
Wearable LED string test
#!/usr/bin/python3
from gpiozero import LED
from time import sleep
from random import randint
led1 = LED(21)
led2 = LED(20)
led3 = LED(16)
led4 = LED(12)
led5 = LED(26)
while True:
led1.on()
sleep((randint(1,100)/200))
led2.on()
sleep((randint(1,100)/200))
led3.on()
sleep((randint(1,100)/200))
led4.on()
sleep((randint(1,100)/200))
led5.on()
sleep((randint(1,100)/200))
led1.off()
sleep((randint(1,100)/200))
led2.off()
sleep((randint(1,100)/200))
led3.off()
sleep((randint(1,100)/200))
led4.off()
sleep((randint(1,100)/200))
led5.off()
sleep((randint(1,100)/200))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment