Skip to content

Instantly share code, notes, and snippets.

@glynrob
Created July 28, 2012 20:16
Show Gist options
  • Save glynrob/3194642 to your computer and use it in GitHub Desktop.
Save glynrob/3194642 to your computer and use it in GitHub Desktop.
Loop through all colours in an array
#!/usr/bin/python
import subprocess
import time
import usblamp
checkTime = 1
arr = ("white", "yellow", "red", "blue", "green")
for i in arr:
print i
usblamp.switchTo(i)
time.sleep(checkTime)
print 'Code exited'
usblamp.switchTo("off")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment